Struct embedded_c_sdk_bind_hal::tick::Tick
source · 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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)