func (aot *AvgOverTime) Clear() {
	aot.que.Init()
	aot.margin = deltaWithInterval{
		delta:    0,
		interval: 0,
	}
	aot.intervalSum = 0
	aot.deltaSum = 0
}
Clear clears the AvgOverTime.
package movingaverage
import (
	"time"
)
type deltaWithInterval struct {
	delta    float64
	interval time.Duration
}
type AvgOverTime struct {
	que         *SafeQueue         
	margin      deltaWithInterval  
	deltaSum    float64            
	intervalSum time.Duration      
	avgInterval time.Duration
}
func NewAvgOverTime(interval time.Duration) *AvgOverTime {
	return &AvgOverTime{
		que: NewSafeQueue(),
		margin: deltaWithInterval{
			delta:    0,
			interval: 0,
		},
		deltaSum:    0,
		intervalSum: 0,
		avgInterval: interval,
	}
}
func (aot *AvgOverTime) Get() float64 {
	if aot.intervalSum < aot.avgInterval {
		return 0
	}
	marginDelta := aot.margin.delta * (aot.intervalSum.Seconds() - aot.avgInterval.Seconds()) / aot.margin.interval.Seconds()
	return (aot.deltaSum - marginDelta) / aot.avgInterval.Seconds()
}