mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Remove timer/internal.rs
This commit is contained in:
1 parent
36d4f82abd
commit
9d61130b44
4 files changed
+22
-24
No files matched your search
@@ -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
@@ -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,
|
||||
}
|
||||
@@ -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)>> {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user