Creating a timer using Lua

前端 未结 6 867
粉色の甜心
粉色の甜心 2020-12-31 13:50

I would like to create a timer using Lua, in a way that I could specify a callback function to be triggered after X seconds have passed.

What would be the best way t

6条回答
  •  醉话见心
    2020-12-31 14:09

    If it's acceptable for you, you can try LuaNode. The following code sets a timer:

    setInterval(function()
        console.log("I run once a minute")
    end, 60000)
    process:loop()
    

提交回复
热议问题