Struct breezy_timer::ProcessTime [−][src]
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.
Implementations
impl ProcessTime
[src]
pub fn try_now() -> Result<ProcessTime, Error>
[src]
Get current CPU time used by a process process
pub fn now() -> ProcessTime
[src]
Get current CPU time used by a process
Panics
If CLOCK_THREAD_CPUTIME_ID
is not supported by the kernel.
On Linux, it was added in version 2.6.12 (year 2005).
On OpenBSD & FreeBSD support was added in 2013.
On MacOS, clock_gettime
was not supported until Sierra (2016).
pub fn try_elapsed(&self) -> Result<Duration, Error>
[src]
Returns the amount of CPU time used from the previous timestamp to now.
pub fn elapsed(&self) -> Duration
[src]
Returns the amount of CPU time used from the previous timestamp to now.
Panics
If ProcessTime::now()
panics.
pub fn duration_since(&self, timestamp: ProcessTime) -> Duration
[src]
Returns the amount of CPU time used from the previous timestamp.
pub fn as_duration(&self) -> Duration
[src]
Returns the total amount of CPU time used from the program start.
Trait Implementations
impl Clone for ProcessTime
[src]
pub fn clone(&self) -> ProcessTime
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ProcessTime
[src]
impl Debug for ProcessTime
[src]
impl Eq for ProcessTime
[src]
impl Hash for ProcessTime
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ProcessTime> for ProcessTime
[src]
pub fn eq(&self, other: &ProcessTime) -> bool
[src]
pub fn ne(&self, other: &ProcessTime) -> bool
[src]
impl StructuralEq for ProcessTime
[src]
impl StructuralPartialEq for ProcessTime
[src]
Auto Trait Implementations
impl RefUnwindSafe for ProcessTime
impl Send for ProcessTime
impl Sync for ProcessTime
impl Unpin for ProcessTime
impl UnwindSafe for ProcessTime
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,