aboutsummaryrefslogtreecommitdiff
path: root/src/tests/example_stack/benches/do_stuff.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/example_stack/benches/do_stuff.rs')
-rw-r--r--src/tests/example_stack/benches/do_stuff.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tests/example_stack/benches/do_stuff.rs b/src/tests/example_stack/benches/do_stuff.rs
index 69d50d5..c7e2e23 100644
--- a/src/tests/example_stack/benches/do_stuff.rs
+++ b/src/tests/example_stack/benches/do_stuff.rs
@@ -1,6 +1,8 @@
-fn main() {
- // TODO: some actual benchmarking, not just a random loop
- for _ in 0..20 {
- example_stack::do_something();
- }
+use criterion::{criterion_group, criterion_main, Criterion};
+
+fn run_benches(c: &mut Criterion) {
+ c.bench_function("do_something", |b| b.iter(|| example_stack::do_something()));
}
+
+criterion_group!(benches, run_benches);
+criterion_main!(benches);