diff --git a/ctru-rs/examples/futures-tokio-basic.rs b/ctru-rs/examples/futures-tokio-basic.rs index 5260e7d..423a45f 100644 --- a/ctru-rs/examples/futures-tokio-basic.rs +++ b/ctru-rs/examples/futures-tokio-basic.rs @@ -38,12 +38,15 @@ fn main() { let sleep_future = tokio::time::sleep_until(wake_time); tokio::select! { - _ = &mut exit_receiver => break, + // Use the first available future instead of randomizing + biased; + _ = sleep_future => { println!("Tick {}", iteration); iteration += 1; wake_time += Duration::from_secs(1); } + _ = &mut exit_receiver => break, } } });