Struct coarsetime::Clock
source · pub struct Clock;
Expand description
System time
Implementations§
source§impl Clock
impl Clock
sourcepub fn now_since_epoch() -> UnixTimeStamp
pub fn now_since_epoch() -> UnixTimeStamp
Returns the elapsed time since the UNIX epoch
sourcepub fn recent_since_epoch() -> UnixTimeStamp
pub fn recent_since_epoch() -> UnixTimeStamp
Returns the elapsed time since the UNIX epoch, based on the latest explicit time update
sourcepub fn update()
pub fn update()
Updates the cached system time.
This function should be called frequently, for example in an event loop
or using an Updater
task.
sourcepub fn set_recent_since_epoch(recent: UnixTimeStamp)
pub fn set_recent_since_epoch(recent: UnixTimeStamp)
Sets the cached system time to the specified timestamp. This function is intended for testing purposes only. It should not be used in production code.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Clock
impl RefUnwindSafe for Clock
impl Send for Clock
impl Sync for Clock
impl Unpin for Clock
impl UnwindSafe for Clock
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