Skip to content

Commit

Permalink
cfg_if! for wasm includes
Browse files Browse the repository at this point in the history
  • Loading branch information
goulart-paul authored May 31, 2024
1 parent 1f0c724 commit 4c08a59
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/timers/timers.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 4c08a59

Please sign in to comment.