Struct amethyst_utils::fps_counter::FPSCounter
[−]
[src]
pub struct FPSCounter { /* fields omitted */ }
The FPSCounter resource needed by the FPSCounterSystem.
Add it to your resources with id 0 to be able to use the FPSCounterSystem.
Usage:
Get the FPSCounter resource from the world then call either frame_fps
or sampled_fps
to
get the FPS.
Methods
impl FPSCounter
[src]
fn new(samplesize: usize) -> FPSCounter
[src]
Creates a new FPSCounter that calculates the average fps over samplesize values.
fn push(&mut self, elem: u64)
[src]
Add a new delta time value.
fn frame_fps(&self) -> f32
[src]
Get the fps of the this frame.
fn sampled_fps(&self) -> f32
[src]
Get the average fps over the samplesize frames.