Stop prevents the Timer from firing. It returns true if the call stops the timer, false if the timer has already expired or been stopped. Stop does not close the channel, to prevent a read from the channel succeeding incorrectly.
()
| 60 | // Stop does not close the channel, to prevent a read from |
| 61 | // the channel succeeding incorrectly. |
| 62 | func (t *Timer) Stop() (wasActive bool) { |
| 63 | if t.f == nil { |
| 64 | panic("timer: Stop called on uninitialized Timer") |
| 65 | } |
| 66 | return delTimer(t) |
| 67 | } |
| 68 | |
| 69 | // Reset changes the timer to expire after duration d. |
| 70 | // It returns true if the timer had been active, |