blob: 4311786720c4520e50f886dbeb18fded7e197492 [file] [log] [blame] [edit]
use crate::time::{Duration, Instant};
pub fn yield_now() {
unsafe {
vex_sdk::vexTasksRun();
}
}
pub fn sleep(dur: Duration) {
let start = Instant::now();
while start.elapsed() < dur {
yield_now();
}
}
pub fn sleep_until(deadline: Instant) {
while Instant::now() < deadline {
yield_now();
}
}