Question : create thread in rust
Answered by : lovely-lemur-u9ps2kjyawrp
use std::thread;
use std::time::Duration;
fn main() { // create a thread thread::spawn(|| { for i in 0..5 { println!("hi number {} from the spawned thread!", i); } });
}
Source : https://www.koderhq.com/tutorial/rust/concurrency/ | Last Update : Sun, 13 Feb 22