pub enum Timer {
NotStarted,
Started {
last_marked: DateTime<Utc>,
},
}Expand description
A timer.
Variants§
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn mark(&mut self) -> Duration
pub fn mark(&mut self) -> Duration
Marks a new instant, returning the number of seconds since the last mark.
The very first mark will return a delta time of 0.0. Because of this,
any time between timer creation and the first mark will have no affect
on the delta times returned.
Sourcepub fn mark_millis(&mut self) -> u64
pub fn mark_millis(&mut self) -> u64
Marks a new instant, returning the number of milliseconds since the last mark.
Trait Implementations§
Source§impl Ord for Timer
impl Ord for Timer
Source§impl PartialOrd for Timer
impl PartialOrd for Timer
impl Copy for Timer
impl Eq for Timer
impl StructuralPartialEq for Timer
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
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