This repository was archived by the owner on May 20, 2024. It is now read-only.
File tree 3 files changed +4
-5
lines changed
3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ jemallocator = "0.5"
12
12
rustc-serialize = { version = " 0.3" , optional = true }
13
13
serde = { version = " 1.0" , features = [" derive" ], optional = true }
14
14
serde_json = { version = " 1.0" , optional = true }
15
- time = " 0.3"
16
15
simd-json = { version = " 0.7" , optional = true }
17
16
simd-json-derive = { version = " 0.7" , optional = true }
18
17
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ pub use self::copy::*;
43
43
pub mod canada;
44
44
45
45
use std:: env;
46
+ use std:: time:: Duration ;
46
47
47
48
pub fn num_trials ( ) -> Option < usize > {
48
49
let mut opts = getopts:: Options :: new ( ) ;
@@ -53,8 +54,8 @@ pub fn num_trials() -> Option<usize> {
53
54
matches. opt_str ( "n" ) . map ( |s| s. parse ( ) . unwrap ( ) )
54
55
}
55
56
56
- pub fn throughput ( dur : time :: Duration , bytes : usize ) -> u64 {
57
- let mut megabytes_per_second = bytes as u64 / dur. whole_microseconds ( ) as u64 ;
57
+ pub fn throughput ( dur : Duration , bytes : usize ) -> u64 {
58
+ let mut megabytes_per_second = bytes as u64 / dur. as_micros ( ) as u64 ;
58
59
59
60
// Round to two significant digits.
60
61
if megabytes_per_second > 100 {
Original file line number Diff line number Diff line change 1
1
use std:: cmp;
2
-
3
- use time:: { Duration , Instant } ;
2
+ use std:: time:: { Duration , Instant } ;
4
3
5
4
pub fn bench < T , F > ( trials : usize , f : F ) -> Duration
6
5
where
You can’t perform that action at this time.
0 commit comments