Struct agents::app::UpdateTimer [−][src]
pub struct UpdateTimer { /* fields omitted */ }
Expand description
The timer is used to compute the time to update and the average update duration.
The timer prints the average update duration to the terminal. It only does this every few seconds to prevent terminal IO from becoming a bottleneck.
Implementations
Tick the timer and return the duration since the last update.
Every so often, this method will write the average duration to the terminal.
Tick the timer and return the duration since the last update.
If the tick is less than the provided duration, then a thread::sleep
is inserted to account for the difference.
Auto Trait Implementations
impl RefUnwindSafe for UpdateTimer
impl Send for UpdateTimer
impl Sync for UpdateTimer
impl Unpin for UpdateTimer
impl UnwindSafe for UpdateTimer
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.