Skip to content
Myr

Fix non-windows build

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Steve Pentland · committed by sharkdp · parent 369f466 · Browse files · 2 files+5 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−3 removed

  • other:+5 added−3 removed

2 files+5 added−3 removed

modified:src/hyperfine/timer/unix_timer.rs+3 added-1 removed
1#![cfg(not(windows))]23use super::internal::{CPUInterval, CPUTimes};4use hyperfine::timer::Timer;5use hyperfine::internal::Second;67use std::mem;89pub struct UnixCPUTimer {10 start_cpu: CPUTimes,11}
1 unmodified line
13impl Timer for UnixCPUTimer {14 type Result = (Second, Second);1516 fn start() -> Self {15 CPUTimer {17 UnixCPUTimer {18 start_cpu: get_cpu_times(),19 }20 }21
60 unmodified lines
modified:src/hyperfine/benchmark.rs+2 added-2 removed
318 unmodified lines
319}320321#[cfg(not(windows))]322fn execute_and_time(command: &str) -> io::Result<ExecuteResult> {323 use hyperfine::timer::cputimer::CPUTimer;323 use hyperfine::timer::unix_timer::UnixCPUTimer;324325 let cpu_timer = CPUTimer::start();325 let cpu_timer = UnixCPUTimer::start();326327 let status = run_shell_command(command)?;328329 let (user_time, system_time) = cpu_timer.stop();
7 unmodified lines