mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
优化定时器
This commit is contained in:
@@ -89,6 +89,11 @@ func (t *Timer) Do(){
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Timer) SetupTimer(now time.Time){
|
||||
t.fireTime = now.Add(t.interval)
|
||||
SetupTimer(t)
|
||||
}
|
||||
|
||||
func (t *Timer) GetInterval() time.Duration{
|
||||
return t.interval
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user