about summary refs log tree commit diff
path: root/library/std/src/sys/thread/vexos.rs
blob: d917dde4d0bc194045a8ea97c9641210686451d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 {
        unsafe {
            vex_sdk::vexTasksRun();
        }
    }
}