Skip to content

Commit

Permalink
fixup: moves the benchmark loop in
Browse files Browse the repository at this point in the history
This allows criterion to run the benchmark loop
with a specific time limit.
  • Loading branch information
filmil committed Oct 1, 2020
1 parent 776a37b commit f695cda
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions components/pluralrules/benches/operands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ fn operands(c: &mut Criterion) {
});

c.bench_function("operands/create/from_fixed_decimal", |b| {
for s in &data.fixed_decimals {
let f: FixedDecimal = FixedDecimal::from(s.value)
.multiplied_pow10(s.exponent)
.unwrap();
b.iter(|| {
b.iter(|| {
for s in &data.fixed_decimals {
let f: FixedDecimal = FixedDecimal::from(s.value)
.multiplied_pow10(s.exponent)
.unwrap();
let _: PluralOperands = PluralOperands::from(black_box(&f));
});
}
}
});
});
}

Expand Down

0 comments on commit f695cda

Please sign in to comment.