std::benchBenchmark harness for measuring function performance.
Provides a simple API for timing function execution with nanosecond precision, warm-up iterations, and formatted output.
import std::bench;
fn main() {
let s = bench.suite("My Benchmarks");
s.add("fib_20", 1000, () => { fibonacci(20); });
s.report();
}
suiteCreate a new benchmark suite.
format_timeFormat a nanosecond duration as a human-readable string with appropriate units.
format_opsFormat an average nanosecond duration as an operations-per-second string.
pad_twoPad a number to two digits with a leading zero if needed.
BenchResultA single benchmark result containing timing statistics.
SuiteA collection of benchmark results.
SuiteMethodsMethods available on a benchmark Suite.