Skip to content

Commit ae63d2b

Browse files
committed
show mean in at-btime
1 parent c021029 commit ae63d2b

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
@@ -562,20 +562,23 @@ is the *minimum* elapsed time measured during the benchmark.
562562
macro btime(args...)
563563
_, params = prunekwargs(args...)
564564
bench, trial, result = gensym(), gensym(), gensym()
565-
trialmin, trialallocs = gensym(), gensym()
565+
trialmin, trialmean, trialallocs = gensym(), gensym(), gensym()
566566
tune_phase = hasevals(params) ? :() : :($BenchmarkTools.tune!($bench))
567567
return esc(quote
568568
local $bench = $BenchmarkTools.@benchmarkable $(args...)
569569
$BenchmarkTools.warmup($bench)
570570
$tune_phase
571571
local $trial, $result = $BenchmarkTools.run_result($bench)
572572
local $trialmin = $BenchmarkTools.minimum($trial)
573+
local $trialmean = $BenchmarkTools.mean($trial)
573574
local $trialallocs = $BenchmarkTools.allocs($trialmin)
574-
println(" ",
575-
$BenchmarkTools.prettytime($BenchmarkTools.time($trialmin)),
575+
println(" min ", $BenchmarkTools.prettytime($BenchmarkTools.time($trialmin)),
576+
", mean ", $BenchmarkTools.prettytime($BenchmarkTools.time($trialmean)),
576577
" (", $trialallocs , " allocation",
577-
$trialallocs == 1 ? "" : "s", ": ",
578-
$BenchmarkTools.prettymemory($BenchmarkTools.memory($trialmin)), ")")
578+
$trialallocs == 1 ? "" : "s",
579+
$trialallocs == 0 ? "" : ": " *
580+
$BenchmarkTools.prettymemory($BenchmarkTools.memory($trialmin)),
581+
")")
579582
$result
580583
end)
581584
end

0 commit comments

Comments
 (0)