Here we show the regular way of doing it with a plain old slice of float64s
(b *testing.B)
| 244 | // Here we show the regular way of doing it |
| 245 | // with a plain old slice of float64s |
| 246 | func 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 |