mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-30 00:38:56 +00:00
Refactor timer module
This commit is contained in:
1 parent
f029a46ff9
commit
defafdf707
6 files changed
+18
-73
No files matched your search
+2
-20
@@ -1,30 +1,12 @@
|
||||
use std::process::Child;
|
||||
|
||||
use crate::util::units::Second;
|
||||
|
||||
pub mod wallclocktimer;
|
||||
|
||||
#[cfg(windows)]
|
||||
mod windows_timer;
|
||||
#[cfg(windows)]
|
||||
pub use self::windows_timer::get_cpu_timer;
|
||||
pub mod windows_timer;
|
||||
|
||||
#[cfg(not(windows))]
|
||||
mod unix_timer;
|
||||
#[cfg(not(windows))]
|
||||
pub use self::unix_timer::get_cpu_timer;
|
||||
|
||||
/// Defines start functionality of a timer.
|
||||
pub trait TimerStart {
|
||||
fn start() -> Self;
|
||||
fn start_for_process(process: &Child) -> Self;
|
||||
}
|
||||
|
||||
/// Defines stop functionality of a timer.
|
||||
pub trait TimerStop {
|
||||
type Result;
|
||||
fn stop(&self) -> Self::Result;
|
||||
}
|
||||
pub mod unix_timer;
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct CPUTimes {
|
||||
|
||||
Reference in new issue
Block a user