aboutsummaryrefslogtreecommitdiff
path: root/src/testing/benchmark.go
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2017-09-06 21:13:06 +0200
committerDaniel Martí <mvdan@mvdan.cc>2017-09-06 19:47:37 +0000
commit261a8d9abdc569a864a2cde37f9b5697501a212d (patch)
tree7d88284d504c06514e3de1ac95458ee9d20dd08e /src/testing/benchmark.go
parent6367c19f26b9b84cee73264522d6ebfc05801053 (diff)
downloadgo-261a8d9abdc569a864a2cde37f9b5697501a212d.tar.xz
testing: use time.Since instead of time.Now().Sub
Change-Id: Ia0479f65a6ef033a65acf9ac8692777839a53b8c Reviewed-on: https://go-review.googlesource.com/61990 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/testing/benchmark.go')
-rw-r--r--src/testing/benchmark.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go
index d592afbf87..2d0de180d7 100644
--- a/src/testing/benchmark.go
+++ b/src/testing/benchmark.go
@@ -86,7 +86,7 @@ func (b *B) StartTimer() {
// want to measure.
func (b *B) StopTimer() {
if b.timerOn {
- b.duration += time.Now().Sub(b.start)
+ b.duration += time.Since(b.start)
runtime.ReadMemStats(&memStats)
b.netAllocs += memStats.Mallocs - b.startAllocs
b.netBytes += memStats.TotalAlloc - b.startBytes