benchmark
Explain how b.N is determined.
func BenchmarkFib10(b *testing.B) {
for n := 0; n < b.N; n++ {
Fib(10)
}
}
Answer
The value of b.N will increase each time until the benchmark runner is satisfied with the stability of the benchmark.
本文档使用 BookStack 构建