Remove timer/internal.rs

This commit is contained in:
David Peter authored and David Peter committed 2021-08-24 22:44:08 +02:00
1 parent 36d4f82abd
commit 9d61130b44
4 files changed
+22 -24

No files matched your search

-19
View File
@@ -1,19 +0,0 @@
use crate::units::Second;
#[derive(Debug, Copy, Clone)]
pub struct CPUTimes {
/// Total amount of time spent executing in user mode
pub user_usec: i64,
/// Total amount of time spent executing in kernel mode
pub system_usec: i64,
}
#[derive(Debug, Copy, Clone)]
pub struct CPUInterval {
/// Total amount of time spent executing in user mode
pub user: Second,
/// Total amount of time spent executing in kernel mode
pub system: Second,
}
+20 -1
View File
@@ -1,6 +1,7 @@
use std::process::Child;
mod internal;
use crate::units::Second;
pub mod wallclocktimer;
#[cfg(windows)]
@@ -24,3 +25,21 @@ pub trait TimerStop {
type Result;
fn stop(&self) -> Self::Result;
}
#[derive(Debug, Copy, Clone)]
pub struct CPUTimes {
/// Total amount of time spent executing in user mode
pub user_usec: i64,
/// Total amount of time spent executing in kernel mode
pub system_usec: i64,
}
#[derive(Debug, Copy, Clone)]
pub struct CPUInterval {
/// Total amount of time spent executing in user mode
pub user: Second,
/// Total amount of time spent executing in kernel mode
pub system: Second,
}
+1 -2
View File
@@ -3,8 +3,7 @@
use std::mem;
use std::process::Child;
use super::internal::{CPUInterval, CPUTimes};
use crate::timer::{TimerStart, TimerStop};
use crate::timer::{CPUInterval, CPUTimes, TimerStart, TimerStop};
use crate::units::Second;
pub fn get_cpu_timer() -> Box<dyn TimerStop<Result = (Second, Second)>> {
+1 -2
View File
@@ -7,8 +7,7 @@ use std::process::Child;
use winapi::um::processthreadsapi::GetProcessTimes;
use winapi::um::winnt::HANDLE;
use super::internal::CPUTimes;
use crate::timer::{TimerStart, TimerStop};
use crate::timer::{CPUTimes, TimerStart, TimerStop};
use crate::units::Second;
const HUNDRED_NS_PER_MS: i64 = 10;