Last active
March 21, 2022 00:11
-
-
Save jtriley-eth/b550b3b31559f011116594574a804157 to your computer and use it in GitHub Desktop.
This file contains 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
// import `thread` module from the standard library | |
use std::thread; | |
// entry point of the program | |
fn main() { | |
// spawn a new thread with the `spawn` method in the `thread` module | |
thread::spawn(|| { | |
println!("hello from the spawned thread"); | |
} | |
println!("hello from the main thread"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment