Skip to content

Instantly share code, notes, and snippets.

@eeeeeta
Created June 1, 2018 07:08
Show Gist options
  • Save eeeeeta/3953e51eb4b7a4d035e627241abb4636 to your computer and use it in GitHub Desktop.
Save eeeeeta/3953e51eb4b7a4d035e627241abb4636 to your computer and use it in GitHub Desktop.
extern crate indicatif;
use indicatif::{ProgressBar, MultiProgress};
use std::thread;
use std::time::Duration;
fn main() {
let mp = MultiProgress::new();
let pb1 = mp.add(ProgressBar::new(100));
let pb2 = mp.add(ProgressBar::new(100));
thread::spawn(move || {
mp.join().unwrap();
});
for _ in 0..100 {
pb1.inc(1);
thread::sleep(Duration::from_millis(100));
}
for _ in 0..100 {
pb2.inc(1);
thread::sleep(Duration::from_millis(100));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment