diff --git a/src/timers/timers.rs b/src/timers/timers.rs index 8e43e6c..741d03f 100644 --- a/src/timers/timers.rs +++ b/src/timers/timers.rs @@ -1,11 +1,15 @@ use std::collections::HashMap; use std::ops::{Deref, DerefMut}; -#[cfg(not(feature="wasm"))] -use std::time::{Duration, Instant}; - -#[cfg(feature = "wasm")] -use web_time::{Duration, Instant}; +cfg_if::cfg_if! { + if #[cfg(feature="wasm")] { + use web_time::{Duration, Instant}; + } + else { + use std::time::{Duration, Instant}; + } +} + #[derive(Debug, Default)] struct InnerTimer {