373 B
373 B
bps
bps
is used to keep track of rates
It is intended to be used as such:
// report on the rate over a 60 second interval, update every second
bw, _ := New(60*time.Second, 60)
bw.Add(10)
b := &bytes.Buffer{}
b.Write([]byte("helloooooooooooooooooooooooooooooooooooooooooooooo"))
io.Copy(bw, b)
time.Sleep(1 * time.Second)
log.Printf("%+v", bw.HumanRate())