package
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: Mar 2, 2020
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
View Source
var (
RepeatForever = -1
RepeatDone = 0
RepeatOnce = 1
)
func KillTimer(this interface{}, id int)
停止定时任务
func SetTimer(this interface{}, id int, elapse int, repeat int, param interface{}) bool
设置定时任务
this 实现OnTimer接口的对象指针
id 定时任务ID
elapse 执行间隔时间(最小单位:毫秒)
repeat 重复次数(-1表示重复执行,大于0则表示执行具体次数)
param 定时任务附带参数(尽量不要传递对象指针)
type ITimer interface {
OnTimer(id int, param interface{})
}
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.