[TWEAK] Small improvements to the benchmark output

This commit is contained in:
2022-12-04 13:27:28 +01:00
parent 6adca06f04
commit 0b0032267e

View File

@@ -50,7 +50,7 @@ fn main() {
if benchmark { if benchmark {
println!("Executed {} rounds;", bench_results.len()); println!("Executed {} rounds in {:.3} s ({} μs, or {} μs on average per round)", bench_results.len(), total_time as f64 / 1000000f64, total_time, total_time / bench_amount as u128);
print_bench_result(&bench_results, |b| b.total, "Execution"); print_bench_result(&bench_results, |b| b.total, "Execution");
print_bench_result(&bench_results, |b| b.init, "Initialization"); print_bench_result(&bench_results, |b| b.init, "Initialization");
print_bench_result(&bench_results, |b| b.part1, "Part 1"); print_bench_result(&bench_results, |b| b.part1, "Part 1");
@@ -58,7 +58,6 @@ fn main() {
println!("First time took {} μs (init {} μs, part 1: {} μs, part 2: {} μs", first_run_bench.total, first_run_bench.init, first_run_bench.part1, first_run_bench.part2); println!("First time took {} μs (init {} μs, part 1: {} μs, part 2: {} μs", first_run_bench.total, first_run_bench.init, first_run_bench.part1, first_run_bench.part2);
println!("Total execute time (of the entire benchmark): {} μs ({} μs on average per round)", total_time, total_time / (DEFAULT_BENCHMARK_AMOUNT as u128));
} else { } else {
println!("Execution took {} μs (init {} μs, part 1: {} μs, part 2: {} μs", first_run_bench.total, first_run_bench.init, first_run_bench.part1, first_run_bench.part2); println!("Execution took {} μs (init {} μs, part 1: {} μs, part 2: {} μs", first_run_bench.total, first_run_bench.init, first_run_bench.part1, first_run_bench.part2);
} }