github.com/loov/hrtime@v1.0.3/hrtesting/benchmark_old.go (about) 1 // +build !nohrtime 2 // +build !go1.13 3 4 package hrtesting 5 6 import "time" 7 8 // Report reports the 50-th, 90-th and 99-th percentile to the log. 9 func (bench *Benchmark) Report() { 10 hist := bench.hr.Histogram(1) 11 bench.b.Logf("%6v₅₀ %6v₉₀ %6v₉₉ N=%v", 12 time.Duration(truncate(hist.P50, 3)), 13 time.Duration(truncate(hist.P90, 3)), 14 time.Duration(truncate(hist.P99, 3)), 15 bench.b.N, 16 ) 17 } 18 19 // Report reports the 50-th, 90-th and 99-th percentile to the log. 20 func (bench *BenchmarkTSC) Report() { 21 hist := bench.hr.Histogram(1) 22 bench.b.Logf("%6v₅₀ %6v₉₀ %6v₉₉ N=%v", 23 truncate(hist.P50, 3), 24 truncate(hist.P90, 3), 25 truncate(hist.P99, 3), 26 bench.b.N, 27 ) 28 }