microasync-util 0.1.7

Utilities for the very small async runner
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use microasync::sync;
use microasync_util::{wait_ms, QueuedRuntime};

fn main() {
    let mut runtime = QueuedRuntime::new();
    for _ in 0..50 {
        runtime.push(print_something_after_ms(2000));
    }
    sync(runtime);
}

async fn print_something_after_ms(ms: u64) {
    wait_ms(ms).await;
    println!("something! :D");
}