mirror of
https://github.com/kepler155c/opus
synced 2025-01-18 19:32:52 +00:00
refactor
This commit is contained in:
parent
69e6af2314
commit
1e011c8bbd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user