薛之猫大王
2026-02-23 af74b152737e345cc59908bbceb87ff82a2f79a5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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