Struct webgl2_glyph::FpsCounter[][src]

pub struct FpsCounter { /* fields omitted */ }
Expand description

Lightweight counter for measuring frames per second using the browser’s Performance API, if available.

The API is designed around use-cases like logging to console.log, rather than a permanent on-screen FPS counter.

Implementations

Construct an object for measuring frames per second. ticks_per determines how many frames the FPS is measured over.

Count a frame. Every self.ticks_per calls to this method, the value Some(fps) is returned where fps is the frames per second over the last ticks_per frames. Every other call to tick returns None.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.