If I have got a ProgressBar with ProgressStyle that uses a template like "… {elapsed}/{duration} …". As usual, I repeatedly call .inc(…) and finally .finish(). However, I am typically getting this kind of printout:
- 0s/4s
- 1s/4s
- 2s/4s
- 3s/4s
- 4s/4s
- 4s/0s
That is, the estimated total duration makes plenty of sense, except that after calling finish it drops to 0. I would expect that duration would reflect the real final duration when the progress bar is finished.
I guess the problem is around lines 292–297 of src/state.rs:
pub fn duration(&self) -> Duration {
if self.len.is_none() || self.is_finished() {
return Duration::new(0, 0);
}
self.started.elapsed() + self.eta()
}
It seems to be explicitly returning 0 when is_finished(). Is this intentional?
If I have got a
ProgressBarwithProgressStylethat uses a template like"… {elapsed}/{duration} …". As usual, I repeatedly call.inc(…)and finally.finish(). However, I am typically getting this kind of printout:That is, the estimated total duration makes plenty of sense, except that after calling
finishit drops to 0. I would expect thatdurationwould reflect the real final duration when the progress bar is finished.I guess the problem is around lines 292–297 of
src/state.rs:It seems to be explicitly returning 0 when
is_finished(). Is this intentional?