Skip to content
Myr

Remove timer/internal.rs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by David Peter · parent 36d4f82 · Browse files · 4 files+22 added−24 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+22 added−24 removed

  • other:+22 added−24 removed

4 files+22 added−24 removed

deleted:src/timer/internal.rs-19 removed
1use crate::units::Second;23#[derive(Debug, Copy, Clone)]4pub struct CPUTimes {5 /// Total amount of time spent executing in user mode6 pub user_usec: i64,78 /// Total amount of time spent executing in kernel mode9 pub system_usec: i64,10}1112#[derive(Debug, Copy, Clone)]13pub struct CPUInterval {14 /// Total amount of time spent executing in user mode15 pub user: Second,1617 /// Total amount of time spent executing in kernel mode18 pub system: Second,19}
modified:src/timer/mod.rs+20 added-1 removed
1use std::process::Child;23mod internal;3use crate::units::Second;45pub mod wallclocktimer;67#[cfg(windows)]8mod windows_timer;
15 unmodified lines
24pub trait TimerStop {25 type Result;26 fn stop(&self) -> Self::Result;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,45}
modified:src/timer/unix_timer.rs+1 added-2 removed
1 unmodified line
23use std::mem;4use std::process::Child;56use super::internal::{CPUInterval, CPUTimes};7use crate::timer::{TimerStart, TimerStop};6use crate::timer::{CPUInterval, CPUTimes, TimerStart, TimerStop};7use crate::units::Second;89pub fn get_cpu_timer() -> Box<dyn TimerStop<Result = (Second, Second)>> {10 Box::new(CPUTimer::start())
85 unmodified lines
modified:src/timer/windows_timer.rs+1 added-2 removed
5 unmodified lines
67use winapi::um::processthreadsapi::GetProcessTimes;8use winapi::um::winnt::HANDLE;910use super::internal::CPUTimes;11use crate::timer::{TimerStart, TimerStop};10use crate::timer::{CPUTimes, TimerStart, TimerStop};11use crate::units::Second;1213const HUNDRED_NS_PER_MS: i64 = 10;14
68 unmodified lines