mirror of https://github.com/lcpz/lain.git
using timer sharing; #114
This commit is contained in:
parent
bceaadb433
commit
5f902517ff
|
@ -77,8 +77,11 @@ end
|
|||
|
||||
helpers.timer_table = {}
|
||||
|
||||
function helpers.newtimer(name, timeout, fun, nostart)
|
||||
helpers.timer_table[name] = capi.timer({ timeout = timeout })
|
||||
function helpers.newtimer(_name, timeout, fun, nostart)
|
||||
local name = timeout
|
||||
if not helpers.timer_table[name] then
|
||||
helpers.timer_table[name] = capi.timer({ timeout = timeout })
|
||||
end
|
||||
helpers.timer_table[name]:connect_signal("timeout", fun)
|
||||
helpers.timer_table[name]:start()
|
||||
if not nostart then
|
||||
|
|
Loading…
Reference in New Issue