Skip to content

Commit

Permalink
Move gettime call outside of benchmark loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
int08h committed May 29, 2024
1 parent 2cf049f commit c3703d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benches/roughenough-bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ use roughenough::{RtMessage, Tag};
fn create_signed_srep_tags(c: &mut Criterion) {
let mut group = c.benchmark_group("signing");
let mut key = OnlineKey::new();
let now = SystemTime::now();
let data = [8u8; 32];

group.throughput(Elements(1));
group.bench_function("create signed SREP tag", |b| {
let now = SystemTime::now();
b.iter(|| black_box(key.make_srep(Version::Rfc, now, data.as_ref())))
b.iter(|| black_box(key.make_srep(Version::Rfc, now, &data)))
});
group.finish();
}
Expand Down

0 comments on commit c3703d9

Please sign in to comment.