mod.rs
This file
Path
src/timer/mod.rs
45 lines · 992 bytes · Rust
Last changed by
Move a few modules to utilDavid Peterbefore adoption5c634c9
History of this fileTake it
Remove cfg-if dependencyDavid Peterbefore adoption60e9771
line 1why, one step back1use std::process::Child;Flat directory/module structureDavid Peterbefore adoption30c381f
line 2why, one step back2Move a few modules to utilDavid Peterbefore adoption5c634c9
line 3why, one step back3use crate::util::units::Second;Remove timer/internal.rsDavid Peterbefore adoption9d61130
line 4why, one step back4Flat directory/module structureDavid Peterbefore adoption30c381f
lines 5–6why, one step back5pub mod wallclocktimer;6Remove cfg-if dependencyDavid Peterbefore adoption60e9771
lines 7–10why, one step back7#[cfg(windows)]8mod windows_timer;9#[cfg(windows)]10pub use self::windows_timer::get_cpu_timer;Flat directory/module structureDavid Peterbefore adoption30c381f
line 11why, one step back11Remove cfg-if dependencyDavid Peterbefore adoption60e9771
lines 12–15why, one step back12#[cfg(not(windows))]13mod unix_timer;14#[cfg(not(windows))]15pub use self::unix_timer::get_cpu_timer;Flat directory/module structureDavid Peterbefore adoption30c381f
lines 16–26why, one step back1617/// Defines start functionality of a timer.18pub trait TimerStart {19 fn start() -> Self;20 fn start_for_process(process: &Child) -> Self;21}2223/// Defines stop functionality of a timer.24pub trait TimerStop {25 type Result;26 fn stop(&self) -> Self::Result;Remove timer/internal.rsDavid Peterbefore adoption9d61130
lines 27–44why, one step back27}2829#[derive(Debug, Copy, Clone)]30pub struct CPUTimes {31 /// Total amount of time spent executing in user mode32 pub user_usec: i64,3334 /// Total amount of time spent executing in kernel mode35 pub system_usec: i64,36}3738#[derive(Debug, Copy, Clone)]39pub struct CPUInterval {40 /// Total amount of time spent executing in user mode41 pub user: Second,4243 /// Total amount of time spent executing in kernel mode44 pub system: Second,Flat directory/module structureDavid Peterbefore adoption30c381f
line 45why, one step back45}