Struct trench::Bencher [] [src]

pub struct Bencher<State, Sp: Spawner = StdThread<()>> { /* fields omitted */ }

A Bencher is the struct the user uses to make a benchmark. The State type is a user chosen type that the benchmarking function is given a reference to.

Methods

impl<St, Sp> Bencher<St, Sp> where
    St: 'static,
    Sp: Spawner,
    Sp::Return: Send + Default + 'static, 
[src]

[src]

Construct a new Bencher. The initial state and the number of threads is given.

[src]

Start a threaded benchmark. All threads will run the function given. The state passed in is shared between all threads.

[src]

Set the closure that is ran before each benchmark iteration.

[src]

Set the closure that is ran afetr each benchmark iteration.

[src]

Convert the Becnher into BenchStats for statistics reporting.

Trait Implementations

Auto Trait Implementations

impl<State, Sp = StdThread<()>> !Send for Bencher<State, Sp>

impl<State, Sp = StdThread<()>> !Sync for Bencher<State, Sp>