Debian Codegraph @

third_party/rust/icu_calendar/benches/iso.rs

raw
1 // This file is part of ICU4X. For terms of use, please see the file
2 // called LICENSE at the top level of the ICU4X source tree
3 // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5 use criterion::{black_box, criterion_group, criterion_main, Criterion};
6 use icu_calendar::{DateTime, Iso};
7
8 fn overview_bench(c: &mut Criterion) {
9 c.bench_function("iso/from_minutes_since_local_unix_epoch", |b| {
10 b.iter(|| {
11 for i in -250..250 {
12 let minutes = i * 10000;
13 DateTime::<Iso>::from_minutes_since_local_unix_epoch(black_box(minutes));
14 }
15 });
16 });
17 }
18
19 criterion_group!(benches, overview_bench,);
20 criterion_main!(benches);