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 ProcessTime
pub fn now() -> ProcessTime
[src]
pub fn now() -> ProcessTime
Get 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) -> Duration
Returns 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) -> Duration
Returns the amount of CPU time used from the previous timestamp.
Trait Implementations
impl Copy for ProcessTime
[src]
impl Copy for ProcessTime
impl Clone for ProcessTime
[src]
impl Clone for ProcessTime
fn clone(&self) -> ProcessTime
[src]
fn clone(&self) -> ProcessTime
Returns 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 ProcessTime
fn eq(&self, other: &ProcessTime) -> bool
[src]
fn eq(&self, other: &ProcessTime) -> bool
This 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) -> bool
This method tests for !=
.
impl Eq for ProcessTime
[src]
impl Eq for ProcessTime
impl Debug for ProcessTime
[src]
impl Debug for ProcessTime
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Hash for ProcessTime
[src]
impl Hash for ProcessTime
Auto Trait Implementations
impl Send for ProcessTime
impl Send for ProcessTime
impl Sync for ProcessTime
impl Sync for ProcessTime