[][src]Struct benchmarking::Benchmark

pub struct Benchmark { /* fields omitted */ }

To execute something and measure the execution time.

Methods

impl Benchmark[src]

pub fn new(count: u64) -> Benchmark[src]

Create an default instance of Benchmark and assign its count.

pub fn get_count(&self) -> u64[src]

pub fn warm_up(&self)[src]

To stimulate CPU to wake up. The running duration is 3 seconds.

pub fn warm_up_with_duration(&self, duration: Duration)[src]

To stimulate CPU to wake up.

pub fn warm_up_multi_thread(&self, thread_count: usize)[src]

To stimulate CPUs to wake up.

pub fn warm_up_multi_thread_with_duration(
    &self,
    thread_count: usize,
    duration: Duration
)
[src]

To stimulate CPUs to wake up. The running duration is 3 seconds.

pub fn bench_function<F>(&mut self, f: F) -> Result<u128, BenchmarkError> where
    F: FnMut(&mut Measurer) + 'static, 
[src]

Run a function and measure its execution time.

Trait Implementations

impl Clone for Benchmark[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Benchmark[src]

fn default() -> Benchmark[src]

Create an default instance of Benchmark whose count is assigned to 10.

impl Debug for Benchmark[src]

Auto Trait Implementations

impl Send for Benchmark

impl Sync for Benchmark

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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.

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

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

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