benchmarking-0.4.1 has been yanked.
Benchmarking
This crate can be used to execute something and measure the execution time. It does not output anything to screens and filesystems.
Examples
extern crate benchmarking;
const VEC_LENGTH: usize = 100;
warm_up;
let bench_result = measure_function.unwrap;
println!;
extern crate benchmarking;
const VEC_LENGTH: usize = 100;
warm_up;
let bench_result = measure_function.unwrap;
println!;
extern crate benchmarking;
const VEC_LENGTH: usize = 100;
warm_up;
let bench_result = measure_function.unwrap;
println!;
- The
warm_upandwarm_up_with_durationfunctions of thebenchmarkingcrate runs on one thread. To warm up all CPUs, you can use thewarm_up_multi_threadandwarm_up_multi_thread_with_durationfunctions instead. - The
measure_functionandmeasure_function_with_timesfunctions of thebenchmarkingcrate can execute a closure for N times. To execute it repeatly for a while instead, you can use thebench_functionandbench_function_with_durationfunctions. - To execute a closure with multiple threads to measure the throughput, you can use the
multi_thread_bench_functionandmulti_thread_bench_function_with_durationfunctions of thebenchmarkingcrate.
Crates.io
https://crates.io/crates/benchmarking