pub struct TickCounter { /* private fields */ }
Expand description
Global tick counter for system uptime and scheduling.
This counter is incremented on every timer interrupt and provides a monotonic time source for scheduling decisions.
Implementations§
Source§impl TickCounter
impl TickCounter
Sourcepub fn increment(&self)
pub fn increment(&self)
Increment the tick counter (called from timer interrupt).
This should only be called from the timer interrupt handler.
Sourcepub fn ticks_to_nanos(&self, ticks: u64) -> u64
pub fn ticks_to_nanos(&self, ticks: u64) -> u64
Convert ticks to nanoseconds.
Sourcepub fn nanos_to_ticks(&self, nanos: u64) -> u64
pub fn nanos_to_ticks(&self, nanos: u64) -> u64
Convert nanoseconds to ticks.
Auto Trait Implementations§
impl !Freeze for TickCounter
impl RefUnwindSafe for TickCounter
impl Send for TickCounter
impl Sync for TickCounter
impl Unpin for TickCounter
impl UnwindSafe for TickCounter
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