diff options
Diffstat (limited to '')
-rw-r--r-- | src/timer.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/timer.go b/src/timer.go index f00ca49..3def253 100644 --- a/src/timer.go +++ b/src/timer.go @@ -43,6 +43,12 @@ func (t *Timer) Reset(dur time.Duration) { t.Start(dur) } +func (t *Timer) Push(dur time.Duration) { + if t.pending.Get() { + t.Reset(dur) + } +} + func (t *Timer) Wait() <-chan time.Time { return t.timer.C } |