use criterion::{black_box, criterion_group, criterion_main, Criterion}; use scorpius::data_structure::queue::Queue; fn criterion_benchmark(c: &mut Criterion) { let mut group = c.benchmark_group("Queue"); let mut queue = Queue::new(); group.bench_function("enqueue", |b| { b.iter(|| { queue.enqueue(black_box(1)); }); }); group.bench_function("dequeue", |b| { b.iter(|| { queue.dequeue(); }); }); group.finish(); } criterion_group!(benches, criterion_benchmark); criterion_main!(benches);