Skip to content

Commit

Permalink
book: fix an example of throughput measurements (#773)
Browse files Browse the repository at this point in the history
* fix an example of throughput measurements

* fix lambda's arg order in an example
  • Loading branch information
loloicci authored Jul 27, 2024
1 parent a19e223 commit a7507e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book/src/user_guide/advanced_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ fn bench(c: &mut Criterion) {

let mut group = c.benchmark_group("throughput-example");
for (i, elements) in [elements_1, elements_2].iter().enumerate() {
group.throughput(Throughput::Elements(elems.len() as u64));
group.bench_with_input(format!("Encode {}", i), elements, |elems, b| {
group.throughput(Throughput::Elements(elements.len() as u64));
group.bench_with_input(format!("Encode {}", i), elements, |b, elems| {
b.iter(||encode(elems))
});
}
Expand Down

0 comments on commit a7507e6

Please sign in to comment.