I'm writing a BASIC interpreter in plain Lua, have hit a wall when writing my SLEEP X function.
I'm no expert but nothing looks wrong here...
function s(time)
local time=tonumber(time)
if useSleep then sleep(time) elseif useWait then wait(time) else
--oh no
--we will try our best
local ct=os.time+time
repeat until(os.time>=ct)
end end
--test
s(5)
Run Code Online (Sandbox Code Playgroud) lua ×1