Function progressive::progress [] [src]

pub fn progress<I: Iterator>(input: I) -> Progress<I>

Wraps an iterator and displays progress information while returning the iterators items.

extern crate progressive;

use progressive::progress;
use std::time::Duration;

fn main() {
    // wrap the range in progress() to see progress information
    for _ in progress(0..10) {
        // do something expensive here
        std::thread::sleep(Duration::from_millis(500));
    }
}