We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3890eed commit 2fe2ba6Copy full SHA for 2fe2ba6
1 file changed
testing/testing/benchmark.go
@@ -376,6 +376,12 @@ func (b *B) launch() {
376
rounds := 100 // TODO: Compute the rounds in a better way
377
roundN := benchN / int(rounds)
378
379
+ // Ensure roundN is at least 1 to prevent division by zero in BenchmarkResult printing
380
+ // when very slow benchmarks can't complete even 1 iteration per round
381
+ if roundN < 1 {
382
+ roundN = 1
383
+ }
384
+
385
for range rounds {
386
b.runN(int(roundN))
387
}
0 commit comments