about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-01-17 17:25:48 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-01-17 17:25:48 +0530
commit00a4eeadaf10156e2e2b7a0c050c2ca1ac826f76 (patch)
tree32d889f7b1af90912bdb6f16e1e0adef7a52c229 /src
parent3ba057b0b1b35660c8b3f2a1a38643de2c0c019b (diff)
parent627829bde84cfdb68ba12020ccfd032585f91dda (diff)
downloadrust-00a4eeadaf10156e2e2b7a0c050c2ca1ac826f76.tar.gz
rust-00a4eeadaf10156e2e2b7a0c050c2ca1ac826f76.zip
Rollup merge of #30959 - bluss:bench-resolution, r=Gankro
test: Increase resolution of MB/s stat for bench runs close to 1 second

MB/s was based on the number of iterations performed in a second, when
the iteration duration nears 1 second (1e9 ns), the resolution of the
MB/s stat decreases.
Diffstat (limited to 'src')
-rw-r--r--src/libtest/lib.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index dcc344c4ffd..00c9d30c563 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -1275,8 +1275,7 @@ pub mod bench {
         let ns_iter_summ = bs.auto_bench(f);
 
         let ns_iter = cmp::max(ns_iter_summ.median as u64, 1);
-        let iter_s = 1_000_000_000 / ns_iter;
-        let mb_s = (bs.bytes * iter_s) / 1_000_000;
+        let mb_s = bs.bytes * 1000 / ns_iter;
 
         BenchSamples {
             ns_iter_summ: ns_iter_summ,