]> Cypherpunks repositories - gostls13.git/commitdiff
testing: improve the usage message of -benchtime
authormontag451 <montag451@laposte.net>
Fri, 4 Aug 2023 22:04:10 +0000 (22:04 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 7 Aug 2023 18:49:02 +0000 (18:49 +0000)
Specify that -benchtime can take the form Nx.

Change-Id: I1e711cdb2e19e3ff5eb2cea4e7c8843bc58696b1
GitHub-Last-Rev: 1cb13f7dba829497c5cbb3d4c578f4984e1cbd28
GitHub-Pull-Request: golang/go#61756
Reviewed-on: https://go-review.googlesource.com/c/go/+/515801
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/testing/benchmark.go

index 0f4fc3d93092a0925b4c4f98a930496a81bc72a9..0faf075d93e075ae31127cdfff4b84a688dc92a1 100644 (file)
@@ -25,7 +25,7 @@ import (
 func initBenchmarkFlags() {
        matchBenchmarks = flag.String("test.bench", "", "run only benchmarks matching `regexp`")
        benchmarkMemory = flag.Bool("test.benchmem", false, "print memory allocations for benchmarks")
-       flag.Var(&benchTime, "test.benchtime", "run each benchmark for duration `d`")
+       flag.Var(&benchTime, "test.benchtime", "run each benchmark for duration `d` or N times if `d` is of the form Nx")
 }
 
 var (