[−][src]Struct game_time::framerate::counter::FrameCounter
A basic frame rate counter.
Methods
impl<S: FrameRateSampler> FrameCounter<S>
[src]
impl<S: FrameRateSampler> FrameCounter<S>
pub fn new(target_frame_rate: f64, sampler: S) -> FrameCounter<S>
[src]
pub fn new(target_frame_rate: f64, sampler: S) -> FrameCounter<S>
Create a new FrameCounter
with a target frame rate and sampler.
pub fn set_slow_threshold(&mut self, val: f64) -> &mut FrameCounter<S>
[src]
pub fn set_slow_threshold(&mut self, val: f64) -> &mut FrameCounter<S>
Set a new slow threshold.
pub fn slow_threshold(&self) -> f64
[src]
pub 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.
pub fn set_target_frame_rate(&mut self, val: f64) -> &mut FrameCounter<S>
[src]
pub fn set_target_frame_rate(&mut self, val: f64) -> &mut FrameCounter<S>
Set the target frame rate.
pub fn is_saturated(&self) -> bool
[src]
pub fn is_saturated(&self) -> bool
Return true if the sampler is saturated.
pub fn sampler(&self) -> &S
[src]
pub fn sampler(&self) -> &S
Return a reference to the sampler object.
Trait Implementations
impl<S: FrameRateSampler> FrameCount for FrameCounter<S>
[src]
impl<S: FrameRateSampler> FrameCount for FrameCounter<S>
fn target_frame_rate(&self) -> f64
[src]
fn target_frame_rate(&self) -> f64
fn target_time_per_frame(&self) -> FloatDuration
[src]
fn target_time_per_frame(&self) -> FloatDuration
fn remaining_frame_time(&self, time: &GameTime) -> FloatDuration
[src]
fn remaining_frame_time(&self, time: &GameTime) -> FloatDuration
fn tick(&mut self, time: &GameTime)
[src]
fn tick(&mut self, time: &GameTime)
fn average_frame_rate(&self) -> f64
[src]
fn average_frame_rate(&self) -> f64
fn is_running_slow(&self, time: &GameTime) -> bool
[src]
fn is_running_slow(&self, time: &GameTime) -> bool
impl<S: Clone + FrameRateSampler> Clone for FrameCounter<S>
[src]
impl<S: Clone + FrameRateSampler> Clone for FrameCounter<S>
fn clone(&self) -> FrameCounter<S>
[src]
fn clone(&self) -> FrameCounter<S>
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<S: Debug + FrameRateSampler> Debug for FrameCounter<S>
[src]
impl<S: Debug + FrameRateSampler> Debug for FrameCounter<S>
Auto Trait Implementations
impl<S> Send for FrameCounter<S> where
S: Send,
impl<S> Send for FrameCounter<S> where
S: Send,
impl<S> Sync for FrameCounter<S> where
S: Sync,
impl<S> Sync for FrameCounter<S> where
S: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T, U> IntoDuration for T where
U: FromDuration<T>,
[src]
impl<T, U> IntoDuration for T where
U: FromDuration<T>,
type Error = <U as FromDuration<T>>::Error
fn into_duration(self) -> Result<U, <U as FromDuration<T>>::Error>
[src]
fn into_duration(self) -> Result<U, <U as FromDuration<T>>::Error>