aboutsummaryrefslogtreecommitdiff
path: root/crates/web-time-compat/src/stdlib.rs
blob: 891a0e0f77894f4a06538d04dd2c157bb30ab5d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! Standard-library time functionality..

// If we've forbidden `now` elsewhere in our project, we enable it here.
// (And only here!)
#![allow(clippy::disallowed_methods)]

pub use std::time::Instant;

use std::time::SystemTime;

impl crate::SystemTimeExt for SystemTime {
    fn get() -> SystemTime {
        SystemTime::now()
    }
}

impl crate::InstantExt for Instant {
    fn get() -> crate::Instant {
        Instant::now()
    }
}