use std::time::Duration;

#[hotpath::measure]
async fn async_function(sleep: u64) {
    let vec1 = vec![1, 2, 3, 5, 6, 7, 8, 9, 10];
    std::hint::black_box(&vec1);
    drop(vec1);
    let vec = vec![1, 2, 3, 5, 6, 7, 8, 9, 10];
    std::hint::black_box(&vec);
    tokio::time::sleep(Duration::from_nanos(sleep)).await;
}

#[tokio::main(flavor = "multi_thread")]
#[hotpath::main(percentiles = [0,99,100])]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    for i in 0..100 {
        async_function(i * 2).await;
    }

    Ok(())
}
