Struct cpu_time::ThreadTime[][src]

pub struct ThreadTime(_, _);

CPU Time Used by The Current Thread

This is an opaque type similar to std::time::Instant. Use elapsed() or duration_since() to get meaningful time deltas.

This type is non-thread-shareable (!Sync, !Send) because otherwise it's to easy to mess up times from different threads. However, you can freely send Duration's returned by elapsed() and duration_since().

Methods

impl ThreadTime
[src]

Get current CPU time used by a process process

Panics

This method panics if linux kernel doesn't support CLOCK_THREAD_CPUTIME_ID, which works since linux 2.6.12 (~ year 2005).

Returns the amount of CPU time used by the current thread from the previous timestamp to now.

Returns the amount of CPU time used by the current thread from the previous timestamp.

Trait Implementations

impl Copy for ThreadTime
[src]

impl Clone for ThreadTime
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for ThreadTime
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for ThreadTime
[src]

impl Debug for ThreadTime
[src]

Formats the value using the given formatter. Read more

impl Hash for ThreadTime
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl !Send for ThreadTime

impl !Sync for ThreadTime