A simple rust library for creating a progress bar
To run the example, type the following
cargo run --example simple
Here is an example of how the library can be used.
extern crate progress_bar_rs;
use progress_bar_rs::ProgressBar;
use std::thread;
use std::time::Duration;
fn main() {
// Amount of steps in the task
let count = 25;
// Create a progress bar struct to keep track of the progress
let mut progress_bar = ProgressBar::new("example task".to_string(), count);
// Start doing the steps of the task
for _ in 0..count {
// Increases the number of step completed by 1
progress_bar.increase();
// Do one of the steps in the task
thread::sleep(Duration::from_millis(200));
}
// Print that the task is completed
progress_bar.finished();
}