Skip to content

Instantly share code, notes, and snippets.

@nectariner
nectariner / main.rs
Created February 20, 2022 18:55
rust_user_input
let mut number = String::new();
io::stdin()
.read_line(&mut number)
.expect("Failed to read input");
Computer Information:
Manufacturer: HUAWEI
Model: BOHK-WAX9X-PCB
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
CPU Family: 0x17
use std::thread;
use std::time::Duration;
let handles: Vec<_> = (0..100)
.map(|num| {
thread::spawn(move || {
thread::sleep(Duration::from_secs(1));
println!("value of {}", num);
})
})