There was an error while loading. Please reload this page.
1 parent 74bbcdd commit b3cacffCopy full SHA for b3cacff
1 file changed
bench_state.go
@@ -22,6 +22,7 @@ package main
22
23
import (
24
"fmt"
25
+ "math"
26
"sort"
27
"time"
28
@@ -139,7 +140,7 @@ func (s *benchmarkState) getQuantile(q float64) time.Duration {
139
140
rightBias := exactIdx - float64(leftIdx)
141
leftBias := 1 - rightBias
142
- return time.Duration(float64(s.latencies[leftIdx])*leftBias + float64(s.latencies[rightIdx])*rightBias)
143
+ return time.Duration(math.Round(float64(s.latencies[leftIdx])*leftBias + float64(s.latencies[rightIdx])*rightBias))
144
}
145
146
type byDuration []time.Duration
0 commit comments