优化定时器AfterTimer

This commit is contained in:
boyce
2021-01-15 15:39:14 +08:00
parent 3e47d2da3a
commit b131aec097
2 changed files with 12 additions and 14 deletions

View File

@@ -172,7 +172,7 @@ func (m *Module) OnAddTimer(t *timer.Timer){
}
}
func (m *Module) AfterFunc(d time.Duration, cb func()) *timer.Timer {
func (m *Module) AfterFunc(d time.Duration, cb func(*timer.Timer)) *timer.Timer {
if m.mapActiveTimer == nil {
m.mapActiveTimer =map[*timer.Timer]interface{}{}
}