mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
added time.uptime() and sleep(timesec)
This commit is contained in:
parent
5188ee7bd8
commit
5c36f59b4f
2 changed files with 21 additions and 0 deletions
|
|
@ -49,3 +49,11 @@ function load_script(path, nocache)
|
|||
end
|
||||
return result
|
||||
end
|
||||
|
||||
function sleep(timesec)
|
||||
local start = time.uptime()
|
||||
while time.uptime() - start < timesec do
|
||||
coroutine.yield()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue