simple_block/
simple_block.rs1
2use progresso::{Progresso, Style, ProgressoBar, ValueDisplay};
3use std::thread;
4
5fn main()
6{
7 let mut style = Style::new_smooth_unicode();
8 style.value_display = ValueDisplay::Percentage;
9 let mut pb = Progresso::new(style);
10
11 pb.set_total(400);
12 for i in 0..401 {
13 pb.erase();
14 pb.set_value(i);
15 pb.draw();
16 thread::sleep(std::time::Duration::from_millis(5));
17 }
18
19 let mut style = Style::new_climbing_blocks_unicode();
20 style.value_display = ValueDisplay::Percentage;
21 let mut pb = Progresso::new(style);
22
23 pb.set_total(400);
24 for i in 0..401 {
25 pb.erase();
26 pb.set_value(i);
27 pb.draw();
28 thread::sleep(std::time::Duration::from_millis(50));
29 }
30}