[][src]Struct fps_ticker::Fps

pub struct Fps { /* fields omitted */ }

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

impl Clone for Fps[src]

impl Debug for Fps[src]

impl Default for Fps[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.