libsw_core/instant_impls/
std_systemtime.rs1extern crate std;
6
7use ::core::time::Duration;
8
9use crate::Instant;
10
11impl Instant for ::std::time::SystemTime {
12 fn now() -> Self {
13 Self::now()
14 }
15
16 fn checked_add(&self, duration: Duration) -> Option<Self> {
17 self.checked_add(duration)
18 }
19
20 fn checked_sub(&self, duration: Duration) -> Option<Self> {
21 self.checked_sub(duration)
22 }
23
24 fn saturating_duration_since(&self, earlier: Self) -> Duration {
25 self.duration_since(earlier).unwrap_or(Duration::ZERO)
28 }
29}