edit | blame | history | raw
local M = {}

local match_timer = nil
local elapsed     = 0

function M.start(duration)
    elapsed = 0
    match_timer = clicli.timer.loop(1.0, function(timer, count)
        elapsed = count
    end, '全局秒表')
end

function M.get_elapsed()
    return elapsed
end

function M.stop()
    if match_timer then
        match_timer:remove()
        match_timer = nil
    end
end

return M