mirror of
https://github.com/kepler155c/opus
synced 2025-01-19 03:42:51 +00:00
refactor
This commit is contained in:
parent
69e6af2314
commit
1e011c8bbd
@ -27,6 +27,13 @@ function Util.tryTimes(attempts, f, ...)
|
|||||||
return unpack(result)
|
return unpack(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Util.Timer()
|
||||||
|
local ct = os.clock()
|
||||||
|
return function()
|
||||||
|
return os.clock() - ct
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function Util.throttle(fn)
|
function Util.throttle(fn)
|
||||||
local ts = os.clock()
|
local ts = os.clock()
|
||||||
local timeout = .095
|
local timeout = .095
|
||||||
|
Loading…
Reference in New Issue
Block a user