-
-
Save theJasonFan/65fa3e514a7fe7b179412f41f7c7168b to your computer and use it in GitHub Desktop.
Hijacking criterion to take input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use criterion::black_box; | |
use criterion::Criterion; | |
fn main() { | |
println!("hijacking criterion"); | |
// https://github.com/bheisler/criterion.rs/blob/b61121bab6305432e635c68bff3444665f0f22b6/src/lib.rs#L700 | |
let mut c = Criterion::default().with_plots().output_directory("SOME_DIR"); | |
c.bench_function("0000", |b| { | |
b.iter(|| black_box(1 + 1)) | |
}); | |
c.final_summary(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment