Created
June 1, 2018 07:08
-
-
Save eeeeeta/3953e51eb4b7a4d035e627241abb4636 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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