headway 0.1.2

An ergonomic progress bar library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use headway::ProgressBarIterable;
use std::{thread, thread::sleep, time::Duration};

#[tokio::main]
async fn main() {
    thread::spawn(|| {
        for i in (0..100).progress() {
            if i == 20 {
                println!("Something went wrong!");
                return;
            }
            sleep(Duration::from_millis(50));
        }
    })
    .join()
    .ok();
}