From d8b72e33724bf3f0de5bfe9c8590f12e3a3e8623 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 6 Oct 2018 20:00:07 -0700 Subject: [PATCH] Allow some extra precision for numbers just above 1000 MB/s --- src/main.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index e2cfef2..83ee4ea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -279,12 +279,7 @@ fn throughput(dur: time::Duration, bytes: usize) -> u64 { let mut megabytes_per_second = bytes as u64 / dur.num_microseconds().unwrap() as u64; // Round to two significant digits. - if megabytes_per_second > 1000 { - if megabytes_per_second % 100 >= 50 { - megabytes_per_second += 100; - } - megabytes_per_second = megabytes_per_second / 100 * 100; - } else if megabytes_per_second > 100 { + if megabytes_per_second > 100 { if megabytes_per_second % 10 >= 5 { megabytes_per_second += 10; }