Sleep A Thread For A Time In Rust
Code
#!/usr/bin/env cargo +nightly -Zscript
//! ```cargo
//! [package]
//! edition = "2021"
//! [dependencies]
//! ```
use std::{thread, time};
fn main() {
let sleep_time = time::Duration::from_millis(1000);
println!("hello");
thread::sleep(sleep_time);
println!("sleep");
}