many_bars/many-bars.rs
1use std::thread;
2use std::time::Duration;
3
4use avance::*;
5
6fn main() {
7 set_max_progress_bars(3);
8
9 std::thread::scope(|t| {
10 for i in 0..15 {
11 t.spawn(move || {
12 AvanceBar::new(1200)
13 .with_desc(format!("task{}", i))
14 .with_iter(0..1200)
15 .for_each(|_| thread::sleep(Duration::from_millis(3 + i % 5)));
16 });
17 }
18 });
19}