如何关闭一个循环定时器/?

请先 登录 后评论

最佳答案 2018-08-27 18:41

对于普通的情况,可以这样使用:

local function abc()

    log.info("timer","test")

end

sys.timerLoopStart(abc, 1000)

sys.timerStop(abc)

不过对于比较风骚的写法,需要这样处理:

local timerPt

timerPt = sys.timerLoopStart(function()

                                              log.info("LoopTimer","test")

                                              end, 1000)

sys.timerStop(timerPt)

请先 登录 后评论

其它 1 个回答

冷红林
擅长:互联网

attachments-2018-08-HPSiiJsG5b834a2cc0f81.png

请先 登录 后评论
  • 1 关注
  • 0 收藏,2186 浏览
  • 新手上路 提出于 2018-08-27 08:45

相似问题