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

Commit

Permalink
Merge branch 'master' into simd-stringify-struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Licenser committed Feb 3, 2023
2 parents b82617c + e9b0fd0 commit a3c623d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jemallocator = "0.5"
rustc-serialize = { version = "0.3", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }
time = "0.3"
simd-json = { version = "0.7", optional = true }
simd-json-derive = { version = "0.7", optional = true }

Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub use self::copy::*;
pub mod canada;

use std::env;
use std::time::Duration;

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

pub fn throughput(dur: time::Duration, bytes: usize) -> u64 {
let mut megabytes_per_second = bytes as u64 / dur.whole_microseconds() as u64;
pub fn throughput(dur: Duration, bytes: usize) -> u64 {
let mut megabytes_per_second = bytes as u64 / dur.as_micros() as u64;

// Round to two significant digits.
if megabytes_per_second > 100 {
Expand Down
3 changes: 1 addition & 2 deletions src/timer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::cmp;

use time::{Duration, Instant};
use std::time::{Duration, Instant};

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

0 comments on commit a3c623d

Please sign in to comment.