diff options
author | plasmatium <slv309@163.com> | 2024-04-26 01:15:34 +0000 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2024-04-29 14:01:17 +0000 |
commit | f6e6b637c0c5e66d177becd4b3539d54636f5705 (patch) | |
tree | 913c8c75b41ccddbe41c9a234016a638f8dd7a13 | |
parent | a81c8b3bf2697b86ac7d3d29d7c0fb71c0716a84 (diff) | |
download | go-f6e6b637c0c5e66d177becd4b3539d54636f5705.tar.gz go-f6e6b637c0c5e66d177becd4b3539d54636f5705.zip |
time: add notes about monotonic time paused
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>
-rw-r--r-- | src/time/time.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/time/time.go b/src/time/time.go index 8c24e1c481..0bbdeaecf5 100644 --- a/src/time/time.go +++ b/src/time/time.go @@ -53,7 +53,10 @@ // // 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, |