pub struct FpsLimiter { /* private fields */ }Expand description
Controls the frame rate of rendering
Implementations§
Source§impl FpsLimiter
impl FpsLimiter
Sourcepub fn should_render(&self) -> bool
pub fn should_render(&self) -> bool
Check if enough time has passed to render the next frame
Sourcepub fn mark_rendered(&mut self)
pub fn mark_rendered(&mut self)
Mark that a frame has been rendered
Sourcepub fn time_until_next_frame(&self) -> Duration
pub fn time_until_next_frame(&self) -> Duration
Get the time remaining until the next frame should be rendered
Sourcepub fn set_max_fps(&mut self, max_fps: u16)
pub fn set_max_fps(&mut self, max_fps: u16)
Update the maximum FPS
Sourcepub fn frame_duration(&self) -> Duration
pub fn frame_duration(&self) -> Duration
Get the frame duration
Sourcepub fn actual_fps(&self) -> f64
pub fn actual_fps(&self) -> f64
Calculate the actual FPS based on the last render time
Trait Implementations§
Source§impl Clone for FpsLimiter
impl Clone for FpsLimiter
Source§fn clone(&self) -> FpsLimiter
fn clone(&self) -> FpsLimiter
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 moreSource§impl Debug for FpsLimiter
impl Debug for FpsLimiter
Auto Trait Implementations§
impl Freeze for FpsLimiter
impl RefUnwindSafe for FpsLimiter
impl Send for FpsLimiter
impl Sync for FpsLimiter
impl Unpin for FpsLimiter
impl UnwindSafe for FpsLimiter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Inspectable for T
impl<T> Inspectable for T
Source§fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
Conditionally inspect this value
Source§fn inspect_with<F>(self, label: &str, f: F) -> Self
fn inspect_with<F>(self, label: &str, f: F) -> Self
Inspect with a custom formatter