fxed readme

This commit is contained in:
Stephen McQuay 2015-09-30 23:12:14 -07:00
parent 16519f1bcf
commit 0dbc9d1d15

View File

@ -4,11 +4,11 @@
It is intended to be used as such: It is intended to be used as such:
// report on 1, 10, 60 second intervals, update every second // report on the rate over a 60 second interval, update every second
bw, _ := NewBandwidth([]int{1, 10, 60}, time.Second) bw, _ := New(60*time.Second, 60)
bw.Add(10) bw.Add(10)
b := &bytes.Buffer{} b := &bytes.Buffer{}
b.Write([]byte("helloooooooooooooooooooooooooooooooooooooooooooooo")) b.Write([]byte("helloooooooooooooooooooooooooooooooooooooooooooooo"))
io.Copy(bw, b) io.Copy(bw, b)
time.Sleep(1 * time.Second) time.Sleep(1 * time.Second)
log.Printf("%+v", bw.Cur()) log.Printf("%+v", bw.HumanRate())