[−][src]Struct benchmarking::Benchmark
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]
&self,
thread_count: usize,
duration: Duration
)
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]
F: FnMut(&mut Measurer) + 'static,
Run a function and measure its execution time.
Trait Implementations
impl Clone for Benchmark
[src]
fn clone(&self) -> 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
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,