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
1 changed files with 3 additions and 4 deletions

View File

@ -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);
}
}