-
-
Save rust-play/a180ee7413ffbee9104f560abb840005 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use tokio::time::{Duration, sleep}; | |
#[tokio::main] | |
async fn main() { | |
for _ in 0..1_000_000 { | |
tokio::spawn(async { | |
sleep(Duration::from_secs(1)).await; | |
}); | |
} | |
println!("Spawned 1M tasks!"); | |
sleep(Duration::from_secs(1)).await; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment