mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-12-14 10:05:44 +00:00
13 lines
No EOL
300 B
Lua
13 lines
No EOL
300 B
Lua
local timer = require("timer")
|
|
local expect = require("expect").expect
|
|
local range = require("expect").range
|
|
|
|
function timer.sleep(n)
|
|
expect(1, n, "number")
|
|
range(1, 1)
|
|
|
|
local timerId = timer.start(n)
|
|
repeat
|
|
local _, par = coroutine.yield("timer")
|
|
until par == timerId
|
|
end |