Skip to content
Myr

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 file

Take it

Remove cfg-if dependencyDavid Peterbefore adoption60e9771

line 1why, one step back
1use std::process::Child;

Flat directory/module structureDavid Peterbefore adoption30c381f

line 2why, one step back
2

Move a few modules to utilDavid Peterbefore adoption5c634c9

line 3why, one step back
3use crate::util::units::Second;

Remove timer/internal.rsDavid Peterbefore adoption9d61130

line 4why, one step back
4

Flat directory/module structureDavid Peterbefore adoption30c381f

lines 5–6why, one step back
5pub mod wallclocktimer;
6

Remove cfg-if dependencyDavid Peterbefore adoption60e9771

lines 7–10why, one step back
7#[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 back
11

Remove cfg-if dependencyDavid Peterbefore adoption60e9771

lines 12–15why, one step back
12#[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 back
16
17/// 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 back
27}
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 back
45}