Lesson 12 of 60
GoBenchmarking & Profiling
15 minutes
Course progress20%
Benchmarking
This lesson explains the main concept clearly with beginner-friendly examples and background so you can learn why the code works.
Benchmarks live in _test.go files and use the *testing.B argument.
func BenchmarkFib(b *testing.B) {
for i := 0; i < b.N; i++ { fib() }
}