aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata
diff options
context:
space:
mode:
authorhopehook <hopehook.com@gmail.com>2022-09-30 10:29:30 +0800
committerGopher Robot <gobot@golang.org>2022-10-02 02:28:27 +0000
commit4585bf96b4025f18682122bbd66d4f2a010b3ac9 (patch)
tree9dd8b78001e9ead43e8602f998d1031a2d4a649c /src/runtime/testdata
parent51297dd6df713b988b5c587e448b27d18ca1bd8a (diff)
downloadgo-4585bf96b4025f18682122bbd66d4f2a010b3ac9.tar.xz
all: use time.Since instead of time.Now().Sub
Change-Id: Ifaa73b64e5b6a1d37c753e2440b642478d7dfbce Reviewed-on: https://go-review.googlesource.com/c/go/+/436957 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: hopehook <hopehook@golangcn.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/runtime/testdata')
-rw-r--r--src/runtime/testdata/testprog/gc.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/testdata/testprog/gc.go b/src/runtime/testdata/testprog/gc.go
index 0f44575381..5dc85fbb62 100644
--- a/src/runtime/testdata/testprog/gc.go
+++ b/src/runtime/testdata/testprog/gc.go
@@ -396,7 +396,7 @@ func gcMemoryLimit(gcPercent int) {
// should do considerably better than this bound.
bound := int64(myLimit + 16<<20)
start := time.Now()
- for time.Now().Sub(start) < 200*time.Millisecond {
+ for time.Since(start) < 200*time.Millisecond {
metrics.Read(m[:])
retained := int64(m[0].Value.Uint64() - m[1].Value.Uint64())
if retained > bound {