pub type Ticks<T> = Instant<T, TicksUnit>;
Expand description
A timestamp from system ticks. Has an arbitrary unit that can be measured with
Ticks::per_second()
.
Aliased Type§
struct Ticks<T>(/* private fields */);
Implementations§
Source§impl<T: Timeline> Ticks<T>
impl<T: Timeline> Ticks<T>
Sourcepub const fn from_raw(raw: i64) -> Self
pub const fn from_raw(raw: i64) -> Self
Return a strongly-typed Ticks
from a raw number of system ticks.
Sourcepub fn per_second() -> i64
pub fn per_second() -> i64
Return the number of high-precision timer ticks in a second.
Wraps the zx_ticks_per_second syscall.
Source§impl Instant<BootTimeline, TicksUnit>
impl Instant<BootTimeline, TicksUnit>
Source§impl Instant<MonotonicTimeline, TicksUnit>
impl Instant<MonotonicTimeline, TicksUnit>
Sourcepub fn get() -> Self
pub fn get() -> Self
Read the number of high-precision timer ticks on the monotonic timeline. These ticks may be processor cycles, high speed timer, profiling timer, etc. They do not advance while the system is suspended.
Wraps the zx_ticks_get syscall.
Trait Implementations
Source§impl<T: Timeline, U: TimeUnit> AddAssign<Duration<T, U>> for Instant<T, U>
impl<T: Timeline, U: TimeUnit> AddAssign<Duration<T, U>> for Instant<T, U>
Source§fn add_assign(&mut self, dur: Duration<T, U>)
fn add_assign(&mut self, dur: Duration<T, U>)
Performs the
+=
operation. Read moreSource§impl<T, U> FromBytes for Instant<T, U>
impl<T, U> FromBytes for Instant<T, U>
Source§impl<T, U> IntoBytes for Instant<T, U>
impl<T, U> IntoBytes for Instant<T, U>
§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Gets the bytes of this value mutably. Read more
§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl<T: Ord, U: Ord> Ord for Instant<T, U>
impl<T: Ord, U: Ord> Ord for Instant<T, U>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd, U: PartialOrd> PartialOrd for Instant<T, U>
impl<T: PartialOrd, U: PartialOrd> PartialOrd for Instant<T, U>
Source§impl<T: Timeline, U: TimeUnit> SubAssign<Duration<T, U>> for Instant<T, U>
impl<T: Timeline, U: TimeUnit> SubAssign<Duration<T, U>> for Instant<T, U>
Source§fn sub_assign(&mut self, dur: Duration<T, U>)
fn sub_assign(&mut self, dur: Duration<T, U>)
Performs the
-=
operation. Read more