Struct game_time::framerate::counter::FrameCounter
[−]
[src]
pub struct FrameCounter<S: FrameRateSampler> { /* fields omitted */ }
A basic frame rate counter.
Methods
impl<S: FrameRateSampler> FrameCounter<S>
[src]
fn new(target_frame_rate: f64, sampler: S) -> FrameCounter<S>
Create a new FrameCounter
with a target frame rate and sampler.
fn set_slow_threshold(&mut self, val: f64) -> &mut FrameCounter<S>
Set a new slow threshold.
fn slow_threshold(&self) -> f64
Return the current slow threshold.
If the current frame rate divided by the target frame rate
is less than this value, then
FrameCount::is_running_slowly
will return true.
fn set_target_frame_rate(&mut self, val: f64) -> &mut FrameCounter<S>
Set the target frame rate.
fn is_saturated(&self) -> bool
Return true if the sampler is saturated.
fn sampler(&self) -> &S
Return a reference to the sampler object.
Trait Implementations
impl<S: Debug + FrameRateSampler> Debug for FrameCounter<S>
[src]
impl<S: Clone + FrameRateSampler> Clone for FrameCounter<S>
[src]
fn clone(&self) -> FrameCounter<S>
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<S: FrameRateSampler> FrameCount for FrameCounter<S>
[src]
fn target_frame_rate(&self) -> f64
The target frame rate for the simulation.
fn target_time_per_frame(&self) -> FloatDuration
The target wall time for each frame.
fn remaining_frame_time(&self, time: &GameTime) -> FloatDuration
The duration remaining to reach the optimal frame time. Read more
fn tick(&mut self, time: &GameTime)
Update the counter for a new frame.
fn average_frame_rate(&self) -> f64
The average frame rate for the current frame.
fn is_running_slow(&self, time: &GameTime) -> bool
Return whether the simulation is running slowly.