MCPcopy Index your code
hub / github.com/desertbit/timer / Stop

Method Stop

timer.go:62–67  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

60// Stop does not close the channel, to prevent a read from
61// the channel succeeding incorrectly.
62func (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,

Callers 4

TestStopFunction · 0.95
TestStopPanicFunction · 0.95
TestMultipleStopFunction · 0.95
timerRoutineFunction · 0.95

Calls 1

delTimerFunction · 0.85

Tested by 3

TestStopFunction · 0.76
TestStopPanicFunction · 0.76
TestMultipleStopFunction · 0.76