]> Cypherpunks repositories - gostls13.git/commitdiff
time: add notes about monotonic time paused
authorplasmatium <slv309@163.com>
Fri, 26 Apr 2024 01:15:34 +0000 (01:15 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 29 Apr 2024 14:01:17 +0000 (14:01 +0000)
See #66870

Change-Id: I781265355a3dbd0d9538bc9dcafaa83b482ec3f8
GitHub-Last-Rev: 9d92f116b05db5568dd4d5834bace659eaf8cc49
GitHub-Pull-Request: golang/go#66922
Reviewed-on: https://go-review.googlesource.com/c/go/+/580515
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joedian Reid <joedian@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/time/time.go

index 8c24e1c48106eff4d59d8bc20b881242ef65bc55..0bbdeaecf5d565626d26c4749ac0741e36d6017c 100644 (file)
 //
 // On some systems the monotonic clock will stop if the computer goes to sleep.
 // On such a system, t.Sub(u) may not accurately reflect the actual
-// time that passed between t and u.
+// time that passed between t and u. The same applies to other functions and
+// methods that subtract times, such as [Since], [Until], [Before], [After],
+// [Add], [Sub], [Equal] and [Compare]. In some cases, you may need to strip
+// the monotonic clock to get accurate results.
 //
 // Because the monotonic clock reading has no meaning outside
 // the current process, the serialized forms generated by t.GobEncode,