Skip to content

Commit ee0a6bd

Browse files
committed
fix(testing): dont pause timer in b.Loop()
1 parent 58d4242 commit ee0a6bd

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

testing/testing/benchmark.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,6 @@ func (b *B) loopSlowPath() bool {
552552
// whereas b.N-based benchmarks must run the benchmark function (and any
553553
// associated setup and cleanup) several times.
554554
func (b *B) Loop() bool {
555-
b.StopTimer()
556555
// This is written such that the fast path is as fast as possible and can be
557556
// inlined.
558557
//
@@ -567,7 +566,6 @@ func (b *B) Loop() bool {
567566
// path can do consistency checks and fail.
568567
if b.loop.i < b.loop.n {
569568
b.loop.i++
570-
b.StartTimer()
571569
return true
572570
}
573571
return b.loopSlowPath()

0 commit comments

Comments
 (0)