diff --git a/src/hyperfine/benchmark.rs b/src/hyperfine/benchmark.rs index d67b802..b3ca8a6 100644 --- a/src/hyperfine/benchmark.rs +++ b/src/hyperfine/benchmark.rs @@ -320,9 +320,9 @@ fn execute_and_time(command: &str) -> io::Result { #[cfg(not(windows))] fn execute_and_time(command: &str) -> io::Result { - use hyperfine::timer::cputimer::CPUTimer; + use hyperfine::timer::unix_timer::UnixCPUTimer; - let cpu_timer = CPUTimer::start(); + let cpu_timer = UnixCPUTimer::start(); let status = run_shell_command(command)?; diff --git a/src/hyperfine/timer/unix_timer.rs b/src/hyperfine/timer/unix_timer.rs index e312676..7cde806 100644 --- a/src/hyperfine/timer/unix_timer.rs +++ b/src/hyperfine/timer/unix_timer.rs @@ -2,7 +2,9 @@ use super::internal::{CPUInterval, CPUTimes}; use hyperfine::timer::Timer; +use hyperfine::internal::Second; +use std::mem; pub struct UnixCPUTimer { start_cpu: CPUTimes, @@ -12,7 +14,7 @@ impl Timer for UnixCPUTimer { type Result = (Second, Second); fn start() -> Self { - CPUTimer { + UnixCPUTimer { start_cpu: get_cpu_times(), } }