using timer sharing; #114
This commit is contained in:
parent
bceaadb433
commit
5f902517ff
1 changed files with 5 additions and 2 deletions
|
@ -77,8 +77,11 @@ end
|
||||||
|
|
||||||
helpers.timer_table = {}
|
helpers.timer_table = {}
|
||||||
|
|
||||||
function helpers.newtimer(name, timeout, fun, nostart)
|
function helpers.newtimer(_name, timeout, fun, nostart)
|
||||||
helpers.timer_table[name] = capi.timer({ timeout = timeout })
|
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]:connect_signal("timeout", fun)
|
||||||
helpers.timer_table[name]:start()
|
helpers.timer_table[name]:start()
|
||||||
if not nostart then
|
if not nostart then
|
||||||
|
|
Loading…
Add table
Reference in a new issue