From 87b3e03d187237f665b376018ea5af0cc5f05814 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez <hector0193@gmail.com> Date: Fri, 28 Jan 2022 17:05:09 +0700 Subject: Enable `instant` only for `wasm32` targets ... and hide the dependency under a `time` module in `iced_native` --- native/src/time.rs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 native/src/time.rs (limited to 'native/src/time.rs') 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}; -- cgit