multi/
multi.rs

1use std::thread;
2use std::time::Duration;
3
4use avance::{AvanceBar, Style};
5
6fn main() {
7    std::thread::scope(|t| {
8        t.spawn(|| {
9            AvanceBar::new(1200)
10                .with_desc("default")
11                .with_iter(0..1200)
12                .for_each(|_| thread::sleep(Duration::from_millis(3)));
13        });
14        t.spawn(|| {
15            AvanceBar::new(1000)
16                .with_style(Style::Balloon)
17                .with_desc("balloon")
18                .with_iter(0..1000)
19                .for_each(|_| thread::sleep(Duration::from_millis(5)));
20        });
21        t.spawn(|| {
22            AvanceBar::new(800)
23                .with_style_str("=>-") // user-defined style
24                .with_desc("custom")
25                .with_iter(0..800)
26                .for_each(|_| thread::sleep(Duration::from_millis(8)));
27        });
28    });
29}