PeekFirst returns the next timer to be scheduled and the time at which it is scheduled to run. It does not modify the contents of the timer queue.
()
| 94 | // at which it is scheduled to run. It does not modify the contents |
| 95 | // of the timer queue. |
| 96 | func (q *Queue) PeekFirst() (t Timer, tm time.Time) { |
| 97 | if len(q.heap) > 0 { |
| 98 | return q.heap[0].timer, q.heap[0].time |
| 99 | } |
| 100 | return nil, time.Time{} |
| 101 | } |
| 102 | |
| 103 | // Advance executes OnTimer callbacks for all timers scheduled to be |
| 104 | // run before the time 'tm'. Executed timers are removed from the |
no outgoing calls