1pub use std::time::SystemTime as Time;
4pub use web_time::{Duration, Instant};
5
6#[cfg(any(feature = "system", feature = "web"))]
8pub fn now() -> Time {
9 #[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
10 {
11 Time::now()
12 }
13 #[cfg(all(target_family = "wasm", target_os = "unknown"))]
14 {
15 use web_time::web::SystemTimeExt;
16 web_time::SystemTime::now().to_std()
17 }
18}
19
20#[cfg(not(any(feature = "system", feature = "web")))]
22pub fn now() -> Time {
23 Time::UNIX_EPOCH
24}