pub struct Bencher {
pub name: String,
pub count: usize,
pub steps: Vec<Step>,
pub bytes: usize,
pub n: usize,
pub poll: usize,
pub format_fn: fn(&Stats, &Bencher),
pub mem_track: (&'static AtomicUsize, &'static AtomicUsize),
}
Fields§
§name: String
§count: usize
§steps: Vec<Step>
§bytes: usize
§n: usize
§poll: usize
§format_fn: fn(&Stats, &Bencher)
§mem_track: (&'static AtomicUsize, &'static AtomicUsize)
Implementations§
Source§impl Bencher
impl Bencher
pub fn new(name: impl AsRef<str>, count: usize, bytes: usize) -> Self
pub fn bench_once<T>( &self, f: &mut impl FnMut() -> T, n: usize, ) -> (u128, usize)
pub fn iter<T>(&mut self, f: impl FnMut() -> T)
pub fn async_iter<'a, T, Fut: Future<Output = T>>( &'a mut self, f: impl FnMut() -> Fut + 'a, ) -> impl Future + 'a
pub fn finish(&self)
pub fn reset_mem(&self)
pub fn get_mem_peak(&self) -> usize
Auto Trait Implementations§
impl Freeze for Bencher
impl RefUnwindSafe for Bencher
impl Send for Bencher
impl Sync for Bencher
impl Unpin for Bencher
impl UnwindSafe for Bencher
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
Mutably borrows from an owned value. Read more