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]
fn new() -> RunningAverageSampler
Construct a new RunningAverageSampler
with a default sample size.
fn with_max_samples(max_samples: u32) -> RunningAverageSampler
Construct a RunningAverageSampler
with a specified sample size.
Trait Implementations
impl Debug for RunningAverageSampler
[src]
impl Clone for RunningAverageSampler
[src]
fn clone(&self) -> RunningAverageSampler
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl FrameRateSampler for RunningAverageSampler
[src]
fn tick(&mut self, time: &GameTime)
Update the frame rate with a new frame.
fn average_frame_rate(&self) -> f64
Return the current frame rate measure.
fn is_saturated(&self) -> bool
Return true if the number of samples fills the cache.
fn max_samples(&self) -> u32
Return the number of samples to average over.
impl Default for RunningAverageSampler
[src]
fn default() -> RunningAverageSampler
Returns the "default value" for a type. Read more