diff options
Diffstat (limited to 'src/pkg/go/doc/testdata/benchmark.go')
-rw-r--r-- | src/pkg/go/doc/testdata/benchmark.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/go/doc/testdata/benchmark.go b/src/pkg/go/doc/testdata/benchmark.go index 0aded5bb4..905e49644 100644 --- a/src/pkg/go/doc/testdata/benchmark.go +++ b/src/pkg/go/doc/testdata/benchmark.go @@ -13,7 +13,7 @@ import ( ) var matchBenchmarks = flag.String("test.bench", "", "regular expression to select benchmarks to run") -var benchTime = flag.Float64("test.benchtime", 1, "approximate run time for each benchmark, in seconds") +var benchTime = flag.Duration("test.benchtime", 1*time.Second, "approximate run time for each benchmark") // An internal type but exported because it is cross-package; part of the implementation // of go test. @@ -151,7 +151,7 @@ func (b *B) launch() { b.runN(n) // Run the benchmark for at least the specified amount of time. - d := time.Duration(*benchTime * float64(time.Second)) + d := *benchTime for !b.failed && b.duration < d && n < 1e9 { last := n // Predict iterations/sec. |