tiny_bench/
lib.rs

1#![warn(clippy::pedantic)]
2#![allow(clippy::cast_precision_loss)]
3#![allow(clippy::cast_possible_truncation)]
4#![allow(clippy::module_name_repetitions)]
5#![allow(clippy::cast_sign_loss)]
6#![deny(missing_docs)]
7//! `tiny-bench`, a tiny benchmarking library.
8//! The crate is divided into two sections, benchmarking and timing.
9//! Benchmarking provides tools to measure code execution, show statistics about that execution,
10//! and compare those statistics to previous runs.
11//! Timing provides tools to time code. Timing how long a closure runs, or how long an iterator runs.
12
13#[cfg(feature = "bench")]
14pub(crate) mod benching;
15
16#[cfg(feature = "bench")]
17pub use benching::{
18    bench, bench_labeled, bench_with_configuration, bench_with_configuration_labeled,
19    bench_with_setup, bench_with_setup_configuration, bench_with_setup_configuration_labeled,
20    bench_with_setup_labeled,
21};
22#[cfg(feature = "bench")]
23pub use output::analysis::criterion::BenchmarkConfig;
24#[cfg(feature = "bench")]
25pub use std::hint::black_box;
26
27#[cfg(any(feature = "bench", feature = "timer"))]
28mod error;
29
30#[cfg(any(feature = "bench", feature = "timer"))]
31pub(crate) mod output;
32
33#[cfg(feature = "timer")]
34pub(crate) mod timing;
35
36#[cfg(feature = "timer")]
37pub use timing::{
38    run_timed, run_timed_from_iterator, run_timed_times, Timeable, TimedIterator, TimingData,
39};