new gears.timer

timer implementation move from c to lua.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
This commit is contained in:
blastmaster 2014-12-12 12:29:51 +01:00 committed by Adrian C. (anrxc)
parent 5869a54b20
commit 44dd0a60cf
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@
local type = type
local pairs = pairs
local tonumber = tonumber
local capi = { timer = timer }
local timer = (type(timer) == 'table' and timer or require("gears.timer"))
local os = { time = os.time }
local table = {
insert = table.insert,
@ -117,7 +117,7 @@ local function regregister(reg)
-- Start the timer
if reg.timer > 0 then
local tm = timers[reg.timer] and timers[reg.timer].timer
tm = tm or capi.timer({ timeout = reg.timer })
tm = tm or timer({ timeout = reg.timer })
if tm.connect_signal then
tm:connect_signal("timeout", reg.update)
else