Skip to main content

web_time_compat/
stdlib.rs

1//! Standard-library time functionality..
2
3// If we've forbidden `now` elsewhere in our project, we enable it here.
4// (And only here!)
5#![allow(clippy::disallowed_methods)]
6
7pub use std::time::Instant;
8
9use std::time::SystemTime;
10
11impl crate::SystemTimeExt for SystemTime {
12    fn get() -> SystemTime {
13        SystemTime::now()
14    }
15}
16
17impl crate::InstantExt for Instant {
18    fn get() -> crate::Instant {
19        Instant::now()
20    }
21}