2018-02-05 18:22:59 -05:00
|
|
|
mod internal;
|
|
|
|
|
|
2018-02-02 17:28:52 +01:00
|
|
|
pub mod wallclocktimer;
|
2018-02-05 18:22:59 -05:00
|
|
|
|
2019-05-07 11:55:38 +02:00
|
|
|
use cfg_if::cfg_if;
|
|
|
|
|
|
2018-02-08 17:13:04 -05:00
|
|
|
cfg_if! {
|
|
|
|
|
if #[cfg(windows)] {
|
|
|
|
|
mod windows_timer;
|
|
|
|
|
pub use self::windows_timer::get_cpu_timer;
|
|
|
|
|
} else {
|
|
|
|
|
mod unix_timer;
|
|
|
|
|
pub use self::unix_timer::get_cpu_timer;
|
|
|
|
|
}
|
2018-02-07 19:03:52 -05:00
|
|
|
}
|
2018-02-08 17:13:04 -05:00
|
|
|
use std::process::Child;
|
2018-02-07 19:03:52 -05:00
|
|
|
|
|
|
|
|
/// Defines start functionality of a timer.
|
|
|
|
|
pub trait TimerStart {
|
2018-02-02 17:28:52 +01:00
|
|
|
fn start() -> Self;
|
2018-02-07 19:03:52 -05:00
|
|
|
fn start_for_process(process: &Child) -> Self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Defines stop functionality of a timer.
|
|
|
|
|
pub trait TimerStop {
|
|
|
|
|
type Result;
|
2018-02-02 17:28:52 +01:00
|
|
|
fn stop(&self) -> Self::Result;
|
|
|
|
|
}
|