We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For background/description, see #132
use indicatif::{MultiProgress, ProgressBar, TickTimeLimit, ProgressStyle, ProgressDrawTarget}; use rand::Rng; use std::thread; use std::time::Duration; fn main() { let sty = ProgressStyle::default_bar() .template("{spinner:.green} [{elapsed_precise}] [{bar:40.cyan/blue}] {bytes}/{total_bytes} ({bytes_per_sec}, {eta}) File") .progress_chars("##-"); let mpb = MultiProgress::with_draw_target(ProgressDrawTarget::stderr_nohz()); let pb1 = mpb.add(ProgressBar::new(30)); let pb2 = mpb.add(ProgressBar::new(30)); pb1.set_style(sty.clone()); pb2.set_style(sty); // To use thread, uncomment this and comment mbp.tick() at bottom. /* let _ = thread::spawn(move || { loop { mpb.tick(TickTimeLimit::Indefinite); thread::sleep(Duration::from_millis(10)); } }); */ let mut rng = rand::thread_rng(); for _ in 0..50 { thread::sleep(Duration::from_millis(2000)); pb1.set_position(rng.gen_range(0, 30)); pb2.set_position(rng.gen_range(0, 30)); mpb.tick(TickTimeLimit::Indefinite); } }
The text was updated successfully, but these errors were encountered:
I don't think this is necessary with current main. If you still run into issues, please reopen.
Sorry, something went wrong.
No branches or pull requests
For background/description, see #132
The text was updated successfully, but these errors were encountered: