storage activity wrong amounts

This commit is contained in:
kepler155c@gmail.com
2017-05-13 23:45:59 -04:00
parent 4cbb2b2257
commit c34b46699b
4 changed files with 24 additions and 6 deletions

View File

@@ -21,6 +21,17 @@ function Util.tryTimes(attempts, f, ...)
return unpack(result)
end
function Util.throttle()
local ts = os.time()
return function()
local nts = os.time()
if nts ~= ts then
ts = nts
os.sleep(0)
end
end
end
function Util.tostring(pattern, ...)
local function serialize(tbl, width)