From 0b0032267efd8ce64ffb319709af18faa71751e4 Mon Sep 17 00:00:00 2001 From: Bas Dado Date: Sun, 4 Dec 2022 13:27:28 +0100 Subject: [PATCH] [TWEAK] Small improvements to the benchmark output --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 55f4059..9dc6e83 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,7 +50,7 @@ fn main() { 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.init, "Initialization"); 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!("Total execute time (of the entire benchmark): {} μs ({} μs on average per round)", total_time, total_time / (DEFAULT_BENCHMARK_AMOUNT as u128)); } 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); }