pub struct TimerSet<Key: Eq + Hash + Clone, T: Tracker, S: Source> { /* private fields */ }
Expand description
A timer set tracks a collection of timers, of which at most one can be running at any given time.
Implementations§
Source§impl<Key, T, S> TimerSet<Key, T, S>
impl<Key, T, S> TimerSet<Key, T, S>
Sourcepub fn start(&mut self, k: Key)
pub fn start(&mut self, k: Key)
Starts a specific timer, stopping the currently running timer (if any).
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns whether the timer is currently running.
pub fn get_stats(&self, k: Key) -> Option<T::Statistics>
Sourcepub fn num_nanoseconds(&self, k: Key) -> Option<u64>
pub fn num_nanoseconds(&self, k: Key) -> Option<u64>
Returns the elapsed time in nanoseconds.
Sourcepub fn num_microseconds(&self, k: Key) -> Option<u64>
pub fn num_microseconds(&self, k: Key) -> Option<u64>
Returns the elapsed time in microseconds.
Sourcepub fn num_milliseconds(&self, k: Key) -> Option<u64>
pub fn num_milliseconds(&self, k: Key) -> Option<u64>
Return the elapsed time in milliseconds.
Sourcepub fn num_seconds(&self, k: Key) -> Option<u64>
pub fn num_seconds(&self, k: Key) -> Option<u64>
Returns the elapsed time in seconds.
Sourcepub fn num_minutes(&self, k: Key) -> Option<u64>
pub fn num_minutes(&self, k: Key) -> Option<u64>
Returns the elapsed time in minutes.
Auto Trait Implementations§
impl<Key, T, S> Freeze for TimerSet<Key, T, S>
impl<Key, T, S> RefUnwindSafe for TimerSet<Key, T, S>
impl<Key, T, S> Send for TimerSet<Key, T, S>
impl<Key, T, S> Sync for TimerSet<Key, T, S>
impl<Key, T, S> Unpin for TimerSet<Key, T, S>
impl<Key, T, S> UnwindSafe for TimerSet<Key, T, S>
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