1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
diff --git a/benches/benchmark.rs b/benches/benchmark.rs
index 3d1d23a..6ccb09d 100644
--- a/benches/benchmark.rs
+++ b/benches/benchmark.rs
@@ -1,13 +1,19 @@
use std::time::Duration;
+#[cfg(bench)]
use tiny_bench::{black_box, BenchmarkConfig};
fn main() {
+ #[cfg(bench)]
bench_test_one();
+ #[cfg(bench)]
bench_test_two();
+ #[cfg(bench)]
bench_test_three();
+ #[cfg(bench)]
bench_test_four();
}
+#[cfg(bench)]
fn bench_test_one() {
tiny_bench::bench_labeled("test one", || {
let mut v: Vec<i32> = Vec::with_capacity(10_000);
@@ -22,6 +28,7 @@ fn bench_test_one() {
});
}
+#[cfg(bench)]
fn bench_test_two() {
tiny_bench::bench_with_setup_labeled(
"test two",
@@ -43,10 +50,12 @@ fn bench_test_two() {
);
}
+#[cfg(bench)]
fn bench_test_three() {
tiny_bench::bench_labeled("test three, empty", || {});
}
+#[cfg(bench)]
fn bench_test_four() {
tiny_bench::bench_with_configuration_labeled(
"test four, max_it",
|