Ver Fonte

Simpler constructor

Richard Crowley há 10 anos atrás
pai
commit
49469ac48f
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      sample.go

+ 1 - 1
sample.go

@@ -55,7 +55,7 @@ func NewExpDecaySample(reservoirSize int, alpha float64) Sample {
 		t0:            time.Now(),
 		values:        newExpDecaySampleHeap(reservoirSize),
 	}
-	s.t1 = time.Now().Add(rescaleThreshold)
+	s.t1 = s.t0.Add(rescaleThreshold)
 	return s
 }