You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
260 B
Rust

use std::{thread,time,process};
fn main() {
let life_expectancy = process::id() % 8;
let t = time::Duration::from_millis(1000);
for _ in 0..life_expectancy {
thread::sleep(t);
}
println!("process {} dies unexpectedly.", process::id());
}