From 940732947c5de95b8424ee5baea71141221e3bd6 Mon Sep 17 00:00:00 2001 From: Steve Pentland Date: Mon, 5 Feb 2018 18:33:19 -0500 Subject: [PATCH] Fix non-windows build --- src/hyperfine/benchmark.rs | 4 ++-- src/hyperfine/timer/unix_timer.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) 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(), } }