Struct style::timer::Timer
[−]
[src]
pub struct Timer { /* fields omitted */ }
A Timer
struct that takes care of giving the current time for animations.
This is needed to be allowed to hook the time in the animations' test-mode.
Methods
impl Timer
[src]
pub fn new() -> Self
[src]
Creates a new "normal" timer, i.e., a "Current" mode timer.
pub fn test_mode() -> Self
[src]
Creates a new "test mode" timer, with initial time 0.
pub fn seconds(&self) -> f64
[src]
Returns the current time, at least from the caller's perspective. In test mode returns whatever the value is.
pub fn increment(&mut self, by: f64)
[src]
Increments the current clock. Panics if the clock is not on test mode.
Trait Implementations
impl Clone for Timer
[src]
fn clone(&self) -> Timer
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more