1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use microasync::sync;
use microasync_util::{get_current_runtime, wait_ms, QueuedRuntime};

fn main() {
    let mut runtime = QueuedRuntime::new();
    runtime.push(print_something_after_ms(0));
    sync(runtime);
}

async fn print_something_after_ms(ms: u64) {
    wait_ms(ms).await;
    println!("something after {ms}ms! :D");
    get_current_runtime()
        .await
        .push(print_something_after_ms(ms + 1));
}