added time.uptime() and sleep(timesec)

This commit is contained in:
MihailRis
2024-01-22 18:38:46 +03:00
parent 5188ee7bd8
commit 5c36f59b4f
2 changed files with 21 additions and 0 deletions
+8
View File
@@ -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