MCPcopy
hub / github.com/montanaflynn/stats / BenchmarkRegularAPI

Function BenchmarkRegularAPI

data_test.go:246–256  ·  view source on GitHub ↗

Here we show the regular way of doing it with a plain old slice of float64s

(b *testing.B)

Source from the content-addressed store, hash-verified

244// Here we show the regular way of doing it
245// with a plain old slice of float64s
246func BenchmarkRegularAPI(b *testing.B) {
247 for i := 0; i < b.N; i++ {
248 data := []float64{-10, -7, -3.11, 5, 1.1, 2, 3, 4.20, 5, 18}
249 _, _ = stats.Min(data)
250 _, _ = stats.Max(data)
251 _, _ = stats.Sum(data)
252 _, _ = stats.Mean(data)
253 _, _ = stats.Median(data)
254 _, _ = stats.Mode(data)
255 }
256}
257
258// Here's where things get interesting
259// and we start to use the included

Callers

nothing calls this directly

Calls 6

MinFunction · 0.92
MaxFunction · 0.92
SumFunction · 0.92
MeanFunction · 0.92
MedianFunction · 0.92
ModeFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…