From 07def8f85916daf6f852f155407fad83e6496a15 Mon Sep 17 00:00:00 2001 From: Sijmen Schoon Date: Fri, 25 Dec 2020 21:30:27 +0100 Subject: [PATCH] rust: Make benchmarker generate readme markdown --- rust/src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rust/src/main.rs b/rust/src/main.rs index 9e3e6fc..efad8b2 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -68,7 +68,7 @@ fn main() { for day in 0..days.len() { let first_run = days[day](false); if first_run.as_nanos() == 0 { - println!("Day {:>2}: skipped", day + 1); + println!("| {:>2} | - |", day + 1); continue; } @@ -79,11 +79,10 @@ fn main() { for _ in 0..repetitions { elapsed += days[day](false) / repetitions; } - println!("Day {:>2}: {:?}", day + 1, elapsed); + println!("| {:>2} | {:>10.2}µs |", day + 1, elapsed.as_secs_f64() * 1_000_000.0); total += elapsed; } - println!("--------------------"); - println!("Total: {:?}", total); + println!("| **Total:** | {:>10.3}ms |", total.as_secs_f64() * 1_000.0); } }