//! Provides `sleep` for all platforms.12pub use thread::sleep;34crate::cfg::switch! {5// TODO: use browser timeouts based on ScheduleRunnerPlugin::build6// crate::cfg::web => { ... }7crate::cfg::std => {8use std::thread;9}10_ => {11mod fallback {12use core::{hint::spin_loop, time::Duration};1314use crate::time::Instant;1516/// Puts the current thread to sleep for at least the specified amount of time.17///18/// As this is a `no_std` fallback implementation, this will spin the current thread.19pub fn sleep(dur: Duration) {20let start = Instant::now();2122while start.elapsed() < dur {23spin_loop();24}25}26}2728use fallback as thread;29}30}313233