Struct game_time::framerate::sample::RunningAverageSampler [] [src]

pub struct RunningAverageSampler { /* fields omitted */ }

A frame rate sampler that computes a moving average from past frames without caching data.

RunningAverageSampler computes the average value by computing (avg*(N-1) + next) / N. This method does not require caching past frames, but is sensitive to large outliers influencing the value for many frames.

Methods

impl RunningAverageSampler
[src]

Construct a new RunningAverageSampler with a default sample size.

Construct a RunningAverageSampler with a specified sample size.

Trait Implementations

impl Debug for RunningAverageSampler
[src]

Formats the value using the given formatter.

impl Clone for RunningAverageSampler
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl FrameRateSampler for RunningAverageSampler
[src]

Update the frame rate with a new frame.

Return the current frame rate measure.

Return true if the number of samples fills the cache.

Return the number of samples to average over.

impl Default for RunningAverageSampler
[src]

Returns the "default value" for a type. Read more