Start starts the timer if not started already
()
| 37 | |
| 38 | // Start starts the timer if not started already |
| 39 | func (m *Timer) Start() { |
| 40 | m.Lock() |
| 41 | defer m.Unlock() |
| 42 | |
| 43 | m.wakeupAttemptsLeft = wakeupAttempts |
| 44 | |
| 45 | if !m.started.IsZero() { |
| 46 | return |
| 47 | } |
| 48 | |
| 49 | m.started = m.clck.Now() |
| 50 | } |
| 51 | |
| 52 | // Reset resets the timer |
| 53 | func (m *Timer) Stop() { |