pub use thread::sleep;
crate::cfg::switch! {
crate::cfg::std => {
use std::thread;
}
_ => {
mod fallback {
use core::{hint::spin_loop, time::Duration};
use crate::time::Instant;
pub fn sleep(dur: Duration) {
let start = Instant::now();
while start.elapsed() < dur {
spin_loop();
}
}
}
use fallback as thread;
}
}