Refactor timer module

This commit is contained in:
David Peter authored and David Peter committed 2022-02-22 10:51:06 +01:00
1 parent f029a46ff9
commit defafdf707
6 files changed
+18 -73

No files matched your search

+2 -20
View File
@@ -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 {