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
11 lines
260 B
Rust
6 years ago
|
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());
|
||
|
}
|