This commit is contained in:
kepler155c@gmail.com 2019-03-01 11:27:27 -05:00
parent 69e6af2314
commit 1e011c8bbd
1 changed files with 7 additions and 0 deletions

View File

@ -27,6 +27,13 @@ function Util.tryTimes(attempts, f, ...)
return unpack(result)
end
function Util.Timer()
local ct = os.clock()
return function()
return os.clock() - ct
end
end
function Util.throttle(fn)
local ts = os.clock()
local timeout = .095