pub struct FixedTimestep { /* private fields */ }Implementations§
Source§impl FixedTimestep
impl FixedTimestep
Sourcepub fn new(hz: u32) -> Self
pub fn new(hz: u32) -> Self
Panics outside 1..=1_000_000_000 Hz, the range supported by nanosecond ticks.
pub fn with_max_catch_up(self, n: u32) -> Self
Sourcepub fn reset_clock(&mut self, now: Instant)
pub fn reset_clock(&mut self, now: Instant)
Discards elapsed and fractional time while preserving the next tick index.
pub fn tick(&self) -> u64
pub fn dt(&self) -> Duration
pub fn dt_seconds(&self) -> f32
Trait Implementations§
Source§impl Clone for FixedTimestep
impl Clone for FixedTimestep
Source§fn clone(&self) -> FixedTimestep
fn clone(&self) -> FixedTimestep
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FixedTimestep
impl RefUnwindSafe for FixedTimestep
impl Send for FixedTimestep
impl Sync for FixedTimestep
impl Unpin for FixedTimestep
impl UnsafeUnpin for FixedTimestep
impl UnwindSafe for FixedTimestep
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