From: Shenghou Ma Date: Wed, 3 Oct 2012 03:41:18 +0000 (+0800) Subject: testing: update package docs to use ResetTimer() instead of StopTimer/StartTimer() X-Git-Tag: go1.1rc2~2268 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=727e5ce95fe11653b4ba197771173c80359bdada;p=gostls13.git testing: update package docs to use ResetTimer() instead of StopTimer/StartTimer() R=golang-dev, rsc, r CC=golang-dev https://golang.org/cl/6591051 --- diff --git a/src/pkg/testing/testing.go b/src/pkg/testing/testing.go index 66d26b8ad8..b30505d76a 100644 --- a/src/pkg/testing/testing.go +++ b/src/pkg/testing/testing.go @@ -27,15 +27,14 @@ // // The benchmark package will vary b.N until the benchmark function lasts // long enough to be timed reliably. The output -// testing.BenchmarkHello 10000000 282 ns/op +// BenchmarkHello 10000000 282 ns/op // means that the loop ran 10000000 times at a speed of 282 ns per loop. // // If a benchmark needs some expensive setup before running, the timer -// may be stopped: +// may be reset: // func BenchmarkBigLen(b *testing.B) { -// b.StopTimer() // big := NewBig() -// b.StartTimer() +// b.ResetTimer() // for i := 0; i < b.N; i++ { // big.Len() // }