use std::io;
use subms::{benchmark, BenchParams, PerfHarness, Recipe};
struct NoopRecipe;
impl Recipe for NoopRecipe {
fn name(&self) -> &str {
"noop"
}
fn run(&self, h: &mut PerfHarness, params: &BenchParams) {
let stage = h.stage("tick", params.entries);
for _ in 0..params.entries {
stage.time(|| {});
}
}
}
fn main() {
let params = BenchParams {
entries: 1_000,
warmup: 0,
seed: 0,
};
let h = benchmark(&NoopRecipe, ¶ms);
let mut out = io::stdout().lock();
h.write_json(&mut out).expect("write json");
}