Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
criterion 0.1.1 - Docs.rs
[go: Go Back, main page]

criterion 0.1.1

Statistics-driven micro-benchmarking library
Documentation
use criterion::Criterion;
use walkdir::WalkDir;

fn config() -> Criterion {
    let mut c = Criterion::default();
    c.without_plots();
    c
}

fn no_plots(c: &mut Criterion) {
    c.bench_function("dummy", |b| b.iter(|| {}));

    let has_svg = !WalkDir::new(".criterion/dummy").into_iter().any(|entry| {
        entry.unwrap().path().extension().and_then(|ext| ext.to_str()) == Some("svg")
    });
    assert!(has_svg)
}

criterion_group!(
    name = benches;
    config = config();
    targets = no_plots
);