[−][src]Struct game_time::framerate::sample::RunningAverageSampler
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]
impl RunningAverageSampler
pub fn new() -> RunningAverageSampler
[src]
pub fn new() -> RunningAverageSampler
Construct a new RunningAverageSampler
with a default sample size.
pub fn with_max_samples(max_samples: u32) -> RunningAverageSampler
[src]
pub fn with_max_samples(max_samples: u32) -> RunningAverageSampler
Construct a RunningAverageSampler
with a specified sample size.
Trait Implementations
impl FrameRateSampler for RunningAverageSampler
[src]
impl FrameRateSampler for RunningAverageSampler
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_saturated(&self) -> bool
[src]
fn is_saturated(&self) -> bool
fn max_samples(&self) -> u32
[src]
fn max_samples(&self) -> u32
impl Default for RunningAverageSampler
[src]
impl Default for RunningAverageSampler
fn default() -> RunningAverageSampler
[src]
fn default() -> RunningAverageSampler
impl Clone for RunningAverageSampler
[src]
impl Clone for RunningAverageSampler
fn clone(&self) -> RunningAverageSampler
[src]
fn clone(&self) -> RunningAverageSampler
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 Debug for RunningAverageSampler
[src]
impl Debug for RunningAverageSampler
Auto Trait Implementations
impl Send for RunningAverageSampler
impl Send for RunningAverageSampler
impl Sync for RunningAverageSampler
impl Sync for RunningAverageSampler
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>