Until now, we have seen how to benchmark our code using the nightly release channel. This is because Rust requires the test nightly feature for benchmarks to run. It's where the test crate and the Bencher types can be found. If you still want to be able to use the stable compiler for everything except benchmarks, you can put all your benchmarks in the benches directory. The stable compiler will ignore them for normal builds, but the nightly compiler will be able to run them.
But, if you really want to use the stable compiler to run benchmarks, you can use the bencher crate. You can find it in crates.io, and using it is really similar to using the built-in nightly benchmarks, since this crate is just a stable port of the benchmarking library.
To use it, you will need to first change the Cargo.toml file to make sure it looks like the following after...