From f6e6b637c0c5e66d177becd4b3539d54636f5705 Mon Sep 17 00:00:00 2001 From: plasmatium Date: Fri, 26 Apr 2024 01:15:34 +0000 Subject: [PATCH] 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 Auto-Submit: Ian Lance Taylor Reviewed-by: Joedian Reid LUCI-TryBot-Result: Go LUCI --- src/time/time.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/time/time.go b/src/time/time.go index 8c24e1c48106e..0bbdeaecf5d56 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,