首次提交
This commit is contained in:
38
target/fastweb/timer.lua
Normal file
38
target/fastweb/timer.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
-- timer.lua
|
||||
local timer = {}
|
||||
timer.__index = timer
|
||||
|
||||
--[[
|
||||
创建一个新的 fw_timer 对象
|
||||
@return 返回一个新的 fw_timer 对象
|
||||
]]
|
||||
function timer.new()
|
||||
local instance = setmetatable({}, timer)
|
||||
instance.module = fw_timer.new()
|
||||
return instance
|
||||
end
|
||||
|
||||
--[[
|
||||
增加一个定时器
|
||||
@param name 定时器名称
|
||||
@param filepath LUA脚本文件路径
|
||||
@param msec 时间间隔(毫秒)
|
||||
@return 返回一个字符串标识
|
||||
]]
|
||||
function timer:add(name, filepath, msec)
|
||||
return self.module:add(name, filepath, msec)
|
||||
end
|
||||
|
||||
--[[
|
||||
移除一个定时器
|
||||
@param name 定时器名称
|
||||
]]
|
||||
function timer:remove(name)
|
||||
self.module:remove(name)
|
||||
end
|
||||
|
||||
|
||||
function timer:self()
|
||||
return self.module:self()
|
||||
end
|
||||
return timer
|
||||
Reference in New Issue
Block a user