]> Cypherpunks repositories - gostls13.git/commitdiff
testing: update package docs to use ResetTimer() instead of StopTimer/StartTimer()
authorShenghou Ma <minux.ma@gmail.com>
Wed, 3 Oct 2012 03:41:18 +0000 (11:41 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Wed, 3 Oct 2012 03:41:18 +0000 (11:41 +0800)
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/6591051

src/pkg/testing/testing.go

index 66d26b8ad8efec61964cd163cc9060bb2a7261cb..b30505d76a10d9d58dba12e09310e4bd244c46ff 100644 (file)
 //
 // 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()
 //         }