pub struct FPS<const MAX_FPS: usize, C: Clock> { /* private fields */ }
Expand description
Measures Frames Per Second (FPS).
MAX_FPS
- Defines the maximum FPS that you expect to measure.
Implementations§
Source§impl<const MAX_FPS: usize, C: Clock> FPS<MAX_FPS, C>
impl<const MAX_FPS: usize, C: Clock> FPS<MAX_FPS, C>
Sourcepub fn tick(&mut self) -> usize
pub fn tick(&mut self) -> usize
Adds another frame tick and returns the current Frames Pre Second.
§Panics
When Clock::try_now()
returns an error or if the MAX_FPS
is reached.
Sourcepub fn tick_max(&mut self) -> usize
pub fn tick_max(&mut self) -> usize
Adds another frame tick and returns the current Frames Pre Second.
This method will not panic if the MAX_FPS
is reached,
instead it will just return the MAX_FPS
value (capping it in a nutshell).
§Panics
If Clock::try_now()
returns an error.
Sourcepub fn try_tick_max(&mut self) -> Result<usize, Error>
pub fn try_tick_max(&mut self) -> Result<usize, Error>
Adds another frame tick and returns the current Frames Pre Second.
This method will not return an error if the MAX_FPS
is reached,
instead it will just return the MAX_FPS
value (capping it in a nutshell).
Trait Implementations§
Auto Trait Implementations§
impl<const MAX_FPS: usize, C> Freeze for FPS<MAX_FPS, C>
impl<const MAX_FPS: usize, C> RefUnwindSafe for FPS<MAX_FPS, C>
impl<const MAX_FPS: usize, C> Send for FPS<MAX_FPS, C>
impl<const MAX_FPS: usize, C> Sync for FPS<MAX_FPS, C>
impl<const MAX_FPS: usize, C> Unpin for FPS<MAX_FPS, C>
impl<const MAX_FPS: usize, C> UnwindSafe for FPS<MAX_FPS, C>
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