File: utc_date_time.rs

package info (click to toggle)
rust-time 0.3.47-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,972 kB
  • sloc: makefile: 2
file content (12 lines) | stat: -rw-r--r-- 281 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
use std::hint::black_box;

use criterion::Bencher;
use time::macros::{offset, utc_datetime};

setup_benchmark! {
    "UtcDateTime",

    fn to_offset(ben: &mut Bencher<'_>) {
        ben.iter(|| black_box(utc_datetime!(2000-01-01 0:00)).to_offset(black_box(offset!(-5))));
    }
}