Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumGobenchmarksSingle-choice MCQ

What does b.ResetTimer() accomplish in this benchmark?

func BenchmarkLookup(b *testing.B) { idx := buildExpensiveIndex() // slow setup b.ResetTimer() for i := 0; i < b.N; i++ { idx.Lookup(keys[i%len(keys)]) } }