pub struct FrameTime {
pub delta_seconds: f32,
pub seconds: f32,
pub frame_time: Instant,
/* private fields */
}Expand description
Keeps track of Timing useful for Games. it keeps track of Delta Seconds and Seconds since the start of the program.
Fields§
§delta_seconds: f32Time between each update call.
seconds: f32Seconds and Milliseconds since program start.
frame_time: Instantlast Instant::Now() since update()
Implementations§
Source§impl FrameTime
impl FrameTime
Sourcepub fn delta_seconds(&self) -> f32
pub fn delta_seconds(&self) -> f32
Returns Delta Second and Delta Milliseconds since last update call.
Sourcepub fn new_recent() -> Self
pub fn new_recent() -> Self
Creates the FrameTime and sets its Start Timer based on recent().
Sourcepub fn update(&mut self)
pub fn update(&mut self)
Updates the Timer to get the current Seconds and Delta Seconds via now()
Sourcepub fn update_recent(&mut self)
pub fn update_recent(&mut self)
Updates the Timer to get the current Seconds and Delta Seconds from the stored timer that is handled by the updater.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FrameTime
impl RefUnwindSafe for FrameTime
impl Send for FrameTime
impl Sync for FrameTime
impl Unpin for FrameTime
impl UnsafeUnpin for FrameTime
impl UnwindSafe for FrameTime
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