#[repr(C)]
pub struct CountAndTime { pub count: u64, pub time_enabled: u64, pub time_running: u64, }
Expand description

The value of a counter, along with timesharing data.

Some counters are implemented in hardware, and the processor can run only a fixed number of them at a time. If more counters are requested than the hardware can support, the kernel timeshares them on the hardware.

This struct holds the value of a counter, together with the time it was enabled, and the proportion of that for which it was actually running.

Fields

count: u64

The counter value.

The meaning of this field depends on how the counter was configured when it was built; see [‘Builder’].

time_enabled: u64

How long this counter was enabled by the program, in nanoseconds.

time_running: u64

How long the kernel actually ran this counter, in nanoseconds.

If time_enabled == time_running, then the counter ran for the entire period it was enabled, without interruption. Otherwise, the counter shared the underlying hardware with others, and you should prorate its value accordingly.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.