Codebase list golang-github-vbauerster-mpb / 40b7bf3
durPerByte Vladimir Bauer 6 years ago
1 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
7272 return d.FormatMsg(*d.completeMsg)
7373 }
7474
75 v := d.average.Value()
76 remaining := time.Duration((st.Total - st.Current) * int64(math.Round(v)))
75 v := math.Round(d.average.Value())
76 remaining := time.Duration((st.Total - st.Current) * int64(v))
7777 if d.normalizer != nil {
7878 remaining = d.normalizer.Normalize(remaining)
7979 }
8585 for _, wd := range wdd {
8686 workDuration = wd
8787 }
88 lastItemEstimate := float64(workDuration) / float64(n)
89 if math.IsInf(lastItemEstimate, 0) || math.IsNaN(lastItemEstimate) {
88 durPerByte := float64(workDuration) / float64(n)
89 if math.IsInf(durPerByte, 0) || math.IsNaN(durPerByte) {
9090 return
9191 }
92 d.average.Add(lastItemEstimate)
92 d.average.Add(durPerByte)
9393 }
9494
9595 func (d *movingAverageETA) OnCompleteMessage(msg string) {