File: max_refresh_rate.rs

package info (click to toggle)
rust-pbr 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 3,924 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 322 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate pbr;
use pbr::ProgressBar;
use std::thread;
use std::time::Duration;

fn main() {
    let mut pb = ProgressBar::new(10000);
    pb.set_max_refresh_rate(Some(Duration::from_secs(1)));

    for _ in 0..10000 {
        pb.inc();
        thread::sleep(Duration::from_millis(1));
    }

    pb.finish_print("");
}