Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

create thread in rust

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 by www.koderhq.com #
 
PREVIOUS NEXT
Tagged: #create #thread #rust
ADD COMMENT
Topic
Name
9+3 =