[−][src]Struct rusty_timer::Timer
The Timer struct calculates delta time and if fixed updates should be done to calculate the times, the crate's stopwatch is used
Implementations
impl Timer
[src]
pub fn new() -> Self
[src]
Create a new timer object time since last fixed update is set to a high number on creation to get a fixed update on start
pub fn time_since_start(&self) -> Duration
[src]
Get the time since start of the timer
pub fn update_delta_time(&mut self)
[src]
update the delta time and time since start place this on the beginning of the loop
pub fn update_fixed_time(&mut self)
[src]
update the time since last fixed update place this after update delta time this function is not required if no fixed update is used
pub fn should_fixed_update(&self) -> bool
[src]
returns a bool if a fixed update should be done this function is not required if no fixed update is used
pub fn set_fixed_interval(&mut self, fixed_interval: Duration)
[src]
set the interval of a fixed update in seconds this function is not required if no fixed update is used
pub fn delta_time(&self) -> Duration
[src]
public getter for the delta time
pub fn fixed_interval(&self) -> Duration
[src]
public getter for the delta fixed interval
pub fn time_since_last_fixed(&self) -> Duration
[src]
public getter for the time since the last fixed update
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,