【发布时间】:2019-04-29 19:08:41
【问题描述】:
我正在用普通 Lua 编写一个 BASIC 解释器,在编写我的 SLEEP X 函数时遇到了困难。
我不是专家,但这里看起来没什么问题...
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)
【问题讨论】:
标签: lua