[][src]Struct benchlib::benching::Bencher

pub struct Bencher { /* fields omitted */ }

Methods

impl Bencher[src]

pub fn new() -> Self[src]

pub fn set_iterations(&mut self, iterations: usize) -> &mut Self[src]

Sets the number of iterations a benchmark will be run If set to 0 it iterates until the standard deviation is below 1%

pub fn bench<T, F: FnMut() -> T>(&mut self, name: &str, func: F) -> &mut Self[src]

Benchmarks a closure a configured number of times. The result will be printed to the console with the given name.

pub fn compare(&mut self) -> &mut Self[src]

Compares the last two benchmarks If the number of benchmarks is below 2 it doesn't do anything

Auto Trait Implementations

impl RefUnwindSafe for Bencher

impl Send for Bencher

impl Sync for Bencher

impl Unpin for Bencher

impl UnwindSafe for Bencher

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.