pub struct Tick(/* private fields */);
Expand description
Represents a point in time as measured by the system tick counter.
This struct is used to keep track of time in terms of ticks, which can be compared or used to measure elapsed time.
Implementations§
Source§impl Tick
impl Tick
Sourcepub fn elapsed(self) -> TickType
pub fn elapsed(self) -> TickType
Computes the number of ticks elapsed since the creation of this Tick
instance.
§Examples
let start_tick = Tick::now();
let elapsed_ticks = start_tick.elapsed();
Sourcepub const fn with_value(value: TickType) -> Self
pub const fn with_value(value: TickType) -> Self
Sourcepub fn elapsed_time(self) -> Duration<TickType, 1, TICK_FREQ_HZ>
pub fn elapsed_time(self) -> Duration<TickType, 1, TICK_FREQ_HZ>
Calculates the elapsed time since the creation of the Tick
instance.
§Returns
- A
Duration
representing the elapsed time in ticks.
Trait Implementations§
Source§impl HalTickHandler for Tick
impl HalTickHandler for Tick
Source§unsafe fn on_sys_tick_interrupt()
unsafe fn on_sys_tick_interrupt()
This function is called by a hardware interrupt to update the system’s tick count. Depending on the build features, it supports either 32-bit or 64-bit tick counters.
Source§impl Ord for Tick
impl Ord for Tick
Source§impl PartialOrd for Tick
impl PartialOrd for Tick
impl Copy for Tick
impl Eq for Tick
impl StructuralPartialEq for Tick
Auto Trait Implementations§
impl Freeze for Tick
impl RefUnwindSafe for Tick
impl Send for Tick
impl Sync for Tick
impl Unpin for Tick
impl UnwindSafe for Tick
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more