#[repr(C)]pub struct Timer { /* private fields */ }
Expand description
A simple timer.
uses real time.
millisecond resolution.
Implementations§
Source§impl Timer
impl Timer
pub fn add(&mut self, ms: u64)
Sourcepub fn done(&mut self) -> bool
pub fn done(&mut self) -> bool
checks if the timer is done.
implicitly calls Timer::update
.
Sourcepub fn until_done(&mut self)
pub fn until_done(&mut self)
blocks the thread until the timer is done.
Sourcepub fn finished(&self) -> bool
pub fn finished(&self) -> bool
checks if the Timer has finished.
does not call Timer::update
.
Trait Implementations§
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