- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for timerHeap (0.16 sec)
-
pkg/test/loadbalancersim/timer/queue.go
return } } } func (h timerHeap) Len() int { return len(h) } func (h timerHeap) Less(i, j int) bool { return h[i].deadline.Before(h[j].deadline) } func (h timerHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] h[i].index = i h[j].index = j } func (h *timerHeap) Push(x any) { e := x.(*entry) *h = append(*h, e) e.index = len(*h) - 1
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Jul 20 19:13:32 UTC 2023 - 3.6K bytes - Viewed (0) -
src/runtime/time.go
n := len(heap) if i >= n { badTimer() } if i*timerHeapN+1 >= n { return } tw := heap[i] when := tw.when if when <= 0 { badTimer() } for { leftChild := i*timerHeapN + 1 if leftChild >= n { break } w := when c := -1 for j, tw := range heap[leftChild:min(leftChild+timerHeapN, n)] { if tw.when < w { w = tw.when
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 29 14:36:24 UTC 2024 - 37.5K bytes - Viewed (0)