pub struct Stats { /* private fields */ }
Expand description
Statistics associated with a given set of benchmark timings.
These are obtained with the stats
method for a given tag.
Statistics are for a moving average of the last N timings for the
tag, where N is currently hardcoded to 30.
Implementations§
source§impl Stats
impl Stats
sourcepub fn total(&self) -> f32
pub fn total(&self) -> f32
Returns the sum total of the timings, in the current unit
of this Stats
.
sourcepub fn average(&self) -> f32
pub fn average(&self) -> f32
Returns the average of the timings, in the current unit
of this Stats
.
sourcepub fn stdev(&self) -> f32
pub fn stdev(&self) -> f32
Returns the standard devication of the timings, in the current unit
of this Stats
.
sourcepub fn max(&self) -> f32
pub fn max(&self) -> f32
Returns the maximum of the timings, in the current unit
of this Stats
.
sourcepub fn unit_postfix(&self) -> &'static str
pub fn unit_postfix(&self) -> &'static str
Returns the postfix string of the Unit associated with this
Stats
, such as “s” for Seconds, “ms” for milliseconds, and
“µs” for microseconds.
sourcepub fn pick_unit(self) -> Stats
pub fn pick_unit(self) -> Stats
Automatically picks an appropriate unit for this Stats
based
on the size of the average value, and converts the stats to
use that unit.
sourcepub fn in_seconds(self) -> Stats
pub fn in_seconds(self) -> Stats
Converts this Stats
to use seconds as a unit
Trait Implementations§
impl Copy for Stats
Auto Trait Implementations§
impl RefUnwindSafe for Stats
impl Send for Stats
impl Sync for Stats
impl Unpin for Stats
impl UnwindSafe for Stats
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Content for Twhere
T: Copy,
impl<T> Content for Twhere T: Copy,
source§unsafe fn read<F, E>(size: usize, f: F) -> Result<T, E>where
F: FnOnce(&mut T) -> Result<(), E>,
unsafe fn read<F, E>(size: usize, f: F) -> Result<T, E>where F: FnOnce(&mut T) -> Result<(), E>,
Owned
.
User-provided closure F
must only write to and not read from &mut Self
.