Skip to content

Commit d2e9ee8

Browse files
committed
show mean in at-btime
1 parent 4009a7a commit d2e9ee8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/execution.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,20 +558,23 @@ is the *minimum* elapsed time measured during the benchmark.
558558
macro btime(args...)
559559
_, params = prunekwargs(args...)
560560
bench, trial, result = gensym(), gensym(), gensym()
561-
trialmin, trialallocs = gensym(), gensym()
561+
trialmin, trialmean, trialallocs = gensym(), gensym(), gensym()
562562
tune_phase = hasevals(params) ? :() : :($BenchmarkTools.tune!($bench))
563563
return esc(quote
564564
local $bench = $BenchmarkTools.@benchmarkable $(args...)
565565
$BenchmarkTools.warmup($bench)
566566
$tune_phase
567567
local $trial, $result = $BenchmarkTools.run_result($bench)
568568
local $trialmin = $BenchmarkTools.minimum($trial)
569+
local $trialmean = $BenchmarkTools.mean($trial)
569570
local $trialallocs = $BenchmarkTools.allocs($trialmin)
570-
println(" ",
571-
$BenchmarkTools.prettytime($BenchmarkTools.time($trialmin)),
571+
println(" min ", $BenchmarkTools.prettytime($BenchmarkTools.time($trialmin)),
572+
", mean ", $BenchmarkTools.prettytime($BenchmarkTools.time($trialmean)),
572573
" (", $trialallocs , " allocation",
573-
$trialallocs == 1 ? "" : "s", ": ",
574-
$BenchmarkTools.prettymemory($BenchmarkTools.memory($trialmin)), ")")
574+
$trialallocs == 1 ? "" : "s",
575+
$trialallocs == 0 ? "" : ": " *
576+
$BenchmarkTools.prettymemory($BenchmarkTools.memory($trialmin)),
577+
")")
575578
$result
576579
end)
577580
end

0 commit comments

Comments
 (0)