Created
April 11, 2023 02:18
-
-
Save thorseraq/d23c6e177dfd75634715e319bd167daa to your computer and use it in GitHub Desktop.
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
| 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