last speed value on complete
Vladimir Bauer
7 years ago
| 226 | 226 | } |
| 227 | 227 | wc.BuildFormat() |
| 228 | 228 | startTime := time.Now() |
| 229 | var str string | |
| 229 | 230 | return DecoratorFunc(func(st *Statistics, widthAccumulator chan<- int, widthDistributor <-chan int) string { |
| 230 | var str string | |
| 231 | if st.Completed { | |
| 232 | return wc.FormatMsg(str, widthAccumulator, widthDistributor) | |
| 233 | } | |
| 231 | 234 | timeElapsed := time.Since(startTime) |
| 232 | 235 | speed := float64(st.Current) / timeElapsed.Seconds() |
| 233 | 236 |