aboutsummaryrefslogtreecommitdiff
path: root/src/testing/synctest/synctest.go
diff options
context:
space:
mode:
authorSean Liao <sean@liao.dev>2025-05-24 12:10:12 +0100
committerSean Liao <sean@liao.dev>2025-05-24 08:42:04 -0700
commitc07ffe980a52b309d48d33265cfee438a01cb513 (patch)
tree1c5a123d65185f349bbc8b1dcd40878c7ac36573 /src/testing/synctest/synctest.go
parent3db50924e2c74dfa0cb9295215529a65880eb708 (diff)
downloadgo-c07ffe980a52b309d48d33265cfee438a01cb513.tar.xz
testing/synctest: correct duration in doc example
Fixes #73839 Change-Id: I961641c6d8244cdeb101a3c9ae91931828a893ad Reviewed-on: https://go-review.googlesource.com/c/go/+/676035 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/testing/synctest/synctest.go')
-rw-r--r--src/testing/synctest/synctest.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/testing/synctest/synctest.go b/src/testing/synctest/synctest.go
index 73fb0a3251..aeac8c4b43 100644
--- a/src/testing/synctest/synctest.go
+++ b/src/testing/synctest/synctest.go
@@ -24,11 +24,11 @@
// synctest.Test(t, func(t *testing.T) {
// start := time.Now() // always midnight UTC 2001-01-01
// go func() {
-// time.Sleep(1 * time.Nanosecond)
-// t.Log(time.Since(start)) // always logs "1ns"
+// time.Sleep(1 * time.Second)
+// t.Log(time.Since(start)) // always logs "1s"
// }()
-// time.Sleep(2 * time.Nanosecond) // the goroutine above will run before this Sleep returns
-// t.Log(time.Since(start)) // always logs "2ns"
+// time.Sleep(2 * time.Second) // the goroutine above will run before this Sleep returns
+// t.Log(time.Since(start)) // always logs "2s"
// })
// }
//