create thread in rust

use std::thread;

fn main() {
    let handle = thread::spawn(|| {
        // code executed in the new thread
        println!("Hello from the new thread!");
    });

    // code executed in the main thread
    println!("Hello from the main thread!");

    handle.join().unwrap();
}