Skip to content
New issue

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

Regression: ETA calculation shows "00:00:00" for the first ten ticks. #81

Closed
sharkdp opened this issue Dec 11, 2018 · 0 comments
Closed

Comments

@sharkdp
Copy link

sharkdp commented Dec 11, 2018

indicatif 0.9 used to show a good ETA estimate after the the first .inc(1) update, but 0.10 seems to require around ten .inc(1) calls until it shows the first ETA that is non-zero.

In my use case, a single "tick" can easily last multiple seconds, so this is easy to notice. Minimal example to reproduce:

extern crate indicatif;

use std::thread;
use std::time::Duration;

use indicatif::{ProgressBar, ProgressStyle};

fn main() {
    let count = 15;
    let pb = ProgressBar::new(count);

    pb.set_style(
        ProgressStyle::default_bar()
            .template("{wide_bar} Elapsed: {elapsed_precise}, ETA: {eta_precise}")
    );

    for _ in 0..count {
        thread::sleep(Duration::from_millis(1000));
        pb.inc(1);
    }
    pb.finish_with_message("done");
}

After 9 seconds, it still shows:

███████████████████░░░░░░░░░░░░░ Elapsed: 00:00:09, ETA: 00:00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant