Lesson 44 of 60
GoWriting Benchmarks – `testing.B`
15 minutes
Course progress73%
Benchmark Example
This lesson explains the main concept clearly with beginner-friendly examples and background so you can learn why the code works.
func BenchmarkEncodeJSON(b *testing.B) {
obj := map[string]int{"a":,:,:}
i := ; i < b.N; i++ {
json.Marshal(obj)
}
}