use std::{thread, time::Duration};
fn main() {
thread::spawn(||{
let handle1 = thread::spawn(||{
some_func(1);
});
let handle2 = thread::spawn(||{
some_func(2);
});
loop {if handle1.is_finished() || handle2.is_finished(){break;}}
}).join().unwrap();
}
fn some_func(number: i32){
for i in 0..10{
println!("Iter {} of thread number: {}", i, number);
thread::sleep(Duration::from_secs(1));
}
}