优化定时器

This commit is contained in:
boyce
2020-10-28 11:30:22 +08:00
parent 019989fe2c
commit 7de290b553
5 changed files with 24 additions and 17 deletions

View File

@@ -28,8 +28,8 @@ type Timer struct {
name string
}
func (t *Timer) Stop() {
t.t.Stop()
func (t *Timer) Close() {
t.t.Close()
t.cb = nil
}
@@ -78,9 +78,9 @@ type Cron struct {
t *Timer
}
func (c *Cron) Stop() {
func (c *Cron) Close() {
if c.t != nil {
c.t.Stop()
c.t.Close()
}
}