MCPcopy Create free account
hub / github.com/desertbit/timer / Reset

Method Reset

timer.go:74–79  ·  view source on GitHub ↗

Reset changes the timer to expire after duration d. It returns true if the timer had been active, false if the timer had expired or been stopped. The channel t.C is cleared and calling t.Reset() behaves as creating a new Timer.

(d time.Duration)

Source from the content-addressed store, hash-verified

72// The channel t.C is cleared and calling t.Reset() behaves as creating a
73// new Timer.
74func (t *Timer) Reset(d time.Duration) bool {
75 if t.f == nil {
76 panic("timer: Reset called on uninitialized Timer")
77 }
78 return resetTimer(t, d)
79}

Callers 9

TestResetFunction · 0.95
TestNegativeResetFunction · 0.95
TestMultipleResetsFunction · 0.95
TestMultipleZeroResetsFunction · 0.95
TestResetChannelClearFunction · 0.95
TestResetPanicFunction · 0.95
TestResetBehaviorFunction · 0.95
timerRoutineFunction · 0.95
TestStoppedTimerFunction · 0.80

Calls 1

resetTimerFunction · 0.85

Tested by 8

TestResetFunction · 0.76
TestNegativeResetFunction · 0.76
TestMultipleResetsFunction · 0.76
TestMultipleZeroResetsFunction · 0.76
TestResetChannelClearFunction · 0.76
TestResetPanicFunction · 0.76
TestResetBehaviorFunction · 0.76
TestStoppedTimerFunction · 0.64