Skip to content

Instantly share code, notes, and snippets.

@thorseraq
Created April 11, 2023 02:18
Show Gist options
  • Select an option

  • Save thorseraq/d23c6e177dfd75634715e319bd167daa to your computer and use it in GitHub Desktop.

Select an option

Save thorseraq/d23c6e177dfd75634715e319bd167daa to your computer and use it in GitHub Desktop.
fn main() {
let rt = tokio::runtime::Runtime::new().unwrap();
let rt2 = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async {
rt2.spawn(async {
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
println!("finished");
});
});
std::thread::sleep(std::time::Duration::from_secs(2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment