[−][src]Struct fps_ticker::Fps
Simple type for tracking frames-per-second.
Implementations
impl Fps
[src]
pub const DEFAULT_WINDOW_LEN: usize
[src]
The window length used by the default constructor.
pub fn with_window_len(window_len: usize) -> Self
[src]
Create a new Fps
with the given window length as a number of frames.
The larger the window, the "smoother" the FPS.
pub fn tick(&self)
[src]
Call this once per frame to allow the Fps
instance to sample the rate internally.
pub fn avg(&self) -> f64
[src]
Retrieve the average frames-per-second at the moment of the last call to tick
.
pub fn min(&self) -> f64
[src]
Retrieve the minimum frames-per-second that was reached within the window at the moment
tick
was last called.
pub fn max(&self) -> f64
[src]
Retrieve the maximum frames-per-second that was reached within the window at the moment
tick
was last called.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Fps
impl Send for Fps
impl !Sync for Fps
impl Unpin for Fps
impl UnwindSafe for Fps
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,