Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Commit a3c623d

Browse files
authored
Merge branch 'master' into simd-stringify-struct
2 parents b82617c + e9b0fd0 commit a3c623d

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jemallocator = "0.5"
1212
rustc-serialize = { version = "0.3", optional = true }
1313
serde = { version = "1.0", features = ["derive"], optional = true }
1414
serde_json = { version = "1.0", optional = true }
15-
time = "0.3"
1615
simd-json = { version = "0.7", optional = true }
1716
simd-json-derive = { version = "0.7", optional = true }
1817

src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub use self::copy::*;
4343
pub mod canada;
4444

4545
use std::env;
46+
use std::time::Duration;
4647

4748
pub fn num_trials() -> Option<usize> {
4849
let mut opts = getopts::Options::new();
@@ -53,8 +54,8 @@ pub fn num_trials() -> Option<usize> {
5354
matches.opt_str("n").map(|s| s.parse().unwrap())
5455
}
5556

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;
5859

5960
// Round to two significant digits.
6061
if megabytes_per_second > 100 {

src/timer.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::cmp;
2-
3-
use time::{Duration, Instant};
2+
use std::time::{Duration, Instant};
43

54
pub fn bench<T, F>(trials: usize, f: F) -> Duration
65
where

0 commit comments

Comments
 (0)