extern crate rand;
extern crate pbr;
use rand::Rng;
use pbr::ProgressBar;
use std::thread;
use std::time::Duration;

fn main() {
    let count = 500;
    let mut pb = ProgressBar::new(count);
    pb.format("╢▌▌░╟");
    for _ in 0..count {
        pb.inc();
        let n = rand::thread_rng().gen_range(0, 100);
        thread::sleep(Duration::from_millis(n));
    }
    pb.finish_println("done!");
}
