[−][src]Trait update_rate::RateCounter
Basic rate counter functionality.
Types which implement RateCounter also implement Display (a string with "
Required methods
fn samples(&self) -> u64
Return the current number of samples the UpdateRateCounter is measuring.
fn set_samples(&mut self, samples: u64)
Set the number of updates which the UpdateRateCounter considers.
Panics
This function may panic if given a samples
value equal to 0.
fn update(&mut self)
Updates the struct in place, but requires a mutable binding.
Call either this OR update_immut()
at the beginning of each
cycle of the periodic activity being measured.
fn rate(&self) -> f64
Return the last calculated rate of operation, in Hertz (updates per second).