Struct cpu_time::ProcessTime [−][src]
pub struct ProcessTime(_);
CPU Time Used by The Whole Process
This is an opaque type similar to std::time::Instant.
Use elapsed() or duration_since() to get meaningful time deltas.
Methods
impl ProcessTime[src]
impl ProcessTimepub fn now() -> ProcessTime[src]
pub fn now() -> ProcessTimeGet current CPU time used by a process process
Panics
This method panics if linux kernel doesn't support CLOCK_PROCESS_CPUTIME_ID, which works since linux 2.6.12 (~ year 2005).
pub fn elapsed(&self) -> Duration[src]
pub fn elapsed(&self) -> DurationReturns the amount of CPU time used from the previous timestamp to now.
pub fn duration_since(&self, timestamp: ProcessTime) -> Duration[src]
pub fn duration_since(&self, timestamp: ProcessTime) -> DurationReturns the amount of CPU time used from the previous timestamp.
Trait Implementations
impl Copy for ProcessTime[src]
impl Copy for ProcessTimeimpl Clone for ProcessTime[src]
impl Clone for ProcessTimefn clone(&self) -> ProcessTime[src]
fn clone(&self) -> ProcessTimeReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl PartialEq for ProcessTime[src]
impl PartialEq for ProcessTimefn eq(&self, other: &ProcessTime) -> bool[src]
fn eq(&self, other: &ProcessTime) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &ProcessTime) -> bool[src]
fn ne(&self, other: &ProcessTime) -> boolThis method tests for !=.
impl Eq for ProcessTime[src]
impl Eq for ProcessTimeimpl Debug for ProcessTime[src]
impl Debug for ProcessTimefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Hash for ProcessTime[src]
impl Hash for ProcessTimeAuto Trait Implementations
impl Send for ProcessTime
impl Send for ProcessTimeimpl Sync for ProcessTime
impl Sync for ProcessTime