diff options
author | 2022-01-28 17:05:09 +0700 | |
---|---|---|
committer | 2022-01-28 21:37:16 +0700 | |
commit | 87b3e03d187237f665b376018ea5af0cc5f05814 (patch) | |
tree | 71509d53f85ed76b1ad2d187652d818230618767 /native/src/time.rs | |
parent | 776724162aa4351310de9f88c7bb8d61b0abca04 (diff) | |
download | iced-87b3e03d187237f665b376018ea5af0cc5f05814.tar.gz iced-87b3e03d187237f665b376018ea5af0cc5f05814.tar.bz2 iced-87b3e03d187237f665b376018ea5af0cc5f05814.zip |
Enable `instant` only for `wasm32` targets
... and hide the dependency under a `time` module in `iced_native`
Diffstat (limited to '')
-rw-r--r-- | native/src/time.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/native/src/time.rs b/native/src/time.rs new file mode 100644 index 00000000..5f95ee86 --- /dev/null +++ b/native/src/time.rs @@ -0,0 +1,7 @@ +//! Keep track of time, both in native and web platforms! + +#[cfg(target_arch = "wasm32")] +pub use instant::{Duration, Instant}; + +#[cfg(not(target_arch = "wasm32"))] +pub use std::time::{Duration, Instant}; |