mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 16:01:55 +03:00
Remove clock goroutine
This is a followup for https://github.com/9seconds/mtg/issues/412 it makes sense to manage timers inplace instead of creating for new goroutines: saves memory
This commit is contained in:
@@ -112,7 +112,7 @@ func (d *Stats) Size() int {
|
||||
return TLSRecordSizeMax
|
||||
}
|
||||
|
||||
func NewStats(durations []time.Duration, drs bool) *Stats {
|
||||
func NewStats(durations []time.Duration, drs bool) Stats {
|
||||
n := float64(len(durations))
|
||||
|
||||
// in milliseconds
|
||||
@@ -162,7 +162,7 @@ func NewStats(durations []time.Duration, drs bool) *Stats {
|
||||
// λ = (Σxᵢᵏ / n)^(1/k)
|
||||
lambda := math.Pow(sumXK/n, 1.0/k)
|
||||
|
||||
return &Stats{
|
||||
return Stats{
|
||||
k: k,
|
||||
lambda: lambda,
|
||||
drs: drs,
|
||||
|
||||
Reference in New Issue
Block a user