MCPcopy Index your code
hub / github.com/beevik/timerqueue / Advance

Method Advance

queue.go:106–113  ·  view source on GitHub ↗

Advance executes OnTimer callbacks for all timers scheduled to be run before the time 'tm'. Executed timers are removed from the timer queue.

(tm time.Time)

Source from the content-addressed store, hash-verified

104// run before the time 'tm'. Executed timers are removed from the
105// timer queue.
106func (q *Queue) Advance(tm time.Time) {
107 for len(q.heap) > 0 && !tm.Before(q.heap[0].time) {
108 data := q.heap[0]
109 heap.Remove(&q.heap, data.index)
110 delete(q.table, data.timer)
111 data.timer.OnTimer(data.time)
112 }
113}
114
115/*
116 * timerHeap

Callers 2

TestAdvanceFunction · 0.80
ExampleQueueFunction · 0.80

Calls 1

OnTimerMethod · 0.65

Tested by 2

TestAdvanceFunction · 0.64
ExampleQueueFunction · 0.64