Completed computes the duration and speed (total per second).
(total float64)
| 53 | |
| 54 | // Completed computes the duration and speed (total per second). |
| 55 | func (v Estimator) Completed(total float64) (totalTime time.Duration, speed float64) { |
| 56 | dur := time.Since(v.startTime) //nolint:forbidigo |
| 57 | if dur <= 0 { |
| 58 | return 0, 0 |
| 59 | } |
| 60 | |
| 61 | return dur, total / dur.Seconds() |
| 62 | } |
| 63 | |
| 64 | // Start returns an Estimator object. |
| 65 | func Start() Estimator { |
no outgoing calls
no test coverage detected