mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-14 11:17:57 +01:00
23 lines
502 B
Rust
23 lines
502 B
Rust
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
|
use executor::prelude::*;
|
|
|
|
fn increment(b: &mut Criterion) {
|
|
let mut sum = 0;
|
|
let executor = Executor::new();
|
|
|
|
b.bench_function("Executor::run", |b| {
|
|
b.iter(|| {
|
|
executor.run(async {
|
|
(0..10_000_000).for_each(|_| {
|
|
sum += 1;
|
|
});
|
|
});
|
|
})
|
|
});
|
|
|
|
black_box(sum);
|
|
}
|
|
|
|
criterion_group!(perf, increment);
|
|
criterion_main!(perf);
|