]>
git.proxmox.com Git - rustc.git/blob - vendor/indicatif/examples/fastbar.rs
1 use indicatif
::ProgressBar
;
3 fn many_units_of_easy_work(n
: u64, label
: &str) {
4 let pb
= ProgressBar
::new(n
);
8 // Any quick computation, followed by an update to the progress bar.
14 println
!("[{}] Sum ({}) calculated in {:?}", label
, sum
, pb
.elapsed());
18 const N
: u64 = 1 << 20;
20 // Perform a long sequence of many simple computations monitored by a
21 // default progress bar.
22 many_units_of_easy_work(N
, "Default progress bar ");