This package uses a double sliding window to calculate item processing speed.
Due to the package's double sliding window design, fluctuations are smoothed out for a more accurate measurement of average speed. This design also means that the average isnt at its most stable until the window is full of data.
This code was inspired and derived from average and slidingwindow
go get -u github.com/aidenesco/progressimport "github.com/aidenesco/progress"
func main() {
w := progress.NewWindow(time.Hour, time.Minute)
defer w.End()
for i := 0; i < 10; i++ {
w.ItemCompleted()
}
fmt.Println(w.Average())
}