rust: Make benchmarker generate readme markdown

This commit is contained in:
Sijmen 2020-12-25 21:30:27 +01:00
parent b8fd7080b6
commit 07def8f859
Signed by: vijfhoek
GPG key ID: DAF7821E067D9C48

View file

@ -68,7 +68,7 @@ fn main() {
for day in 0..days.len() { for day in 0..days.len() {
let first_run = days[day](false); let first_run = days[day](false);
if first_run.as_nanos() == 0 { if first_run.as_nanos() == 0 {
println!("Day {:>2}: skipped", day + 1); println!("| {:>2} | - |", day + 1);
continue; continue;
} }
@ -79,11 +79,10 @@ fn main() {
for _ in 0..repetitions { for _ in 0..repetitions {
elapsed += days[day](false) / 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; total += elapsed;
} }
println!("--------------------"); println!("| **Total:** | {:>10.3}ms |", total.as_secs_f64() * 1_000.0);
println!("Total: {:?}", total);
} }
} }