Trait game_time::framerate::sample::FrameRateSampler
[−]
[src]
pub trait FrameRateSampler: Debug { fn tick(&mut self, time: &GameTime); fn average_frame_rate(&self) -> f64; fn is_saturated(&self) -> bool; fn max_samples(&self) -> u32; }
Frame rate computation.
FrameRateSampler
provides methods to take the time at each frame and compute
a frame rate metric through some method.
Required Methods
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.
Implementors
impl FrameRateSampler for RunningAverageSampler
impl FrameRateSampler for LinearAverageSampler