use criterion::{black_box, criterion_group, criterion_main, Criterion}; use cwmp::parse; fn criterion_benchmark(c: &mut Criterion) { c.bench_function("parse add_object", |b| b.iter(|| parse(black_box(String::from(r#" API_aa0642e34b23820801e7642ad7cb536c Device.Test. ParamKey "#))))); } criterion_group!(benches, criterion_benchmark); criterion_main!(benches);