pub struct TimeProvider;Expand description
Time provider
Implementations§
Source§impl TimeProvider
impl TimeProvider
Sourcepub fn now_micros(&self) -> u64
pub fn now_micros(&self) -> u64
Get current time as microseconds since epoch
Sourcepub fn now_millis(&self) -> u64
pub fn now_millis(&self) -> u64
Get current time as milliseconds since epoch
Sourcepub fn now(&self) -> SystemTime
pub fn now(&self) -> SystemTime
Get current system time
Sourcepub fn duration_from_millis(&self, millis: u64) -> Duration
pub fn duration_from_millis(&self, millis: u64) -> Duration
Create duration from milliseconds
Sourcepub fn duration_from_secs(&self, secs: u64) -> Duration
pub fn duration_from_secs(&self, secs: u64) -> Duration
Create duration from seconds
Trait Implementations§
Source§impl Debug for TimeProvider
impl Debug for TimeProvider
Auto Trait Implementations§
impl Freeze for TimeProvider
impl RefUnwindSafe for TimeProvider
impl Send for TimeProvider
impl Sync for TimeProvider
impl Unpin for TimeProvider
impl UnsafeUnpin for TimeProvider
impl UnwindSafe for TimeProvider
Blanket Implementations§
impl<T> Allocation for T
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