aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2018-03-29 07:55:30 -0700
committerIan Lance Taylor <iant@golang.org>2018-04-13 00:50:22 +0000
commitc96ac60bcdd9c3c170fd70cc1b8b5ebfcda2d776 (patch)
treeeb5d393eafd448ef7dad8ee569fb057dae499291 /src
parent86181120bd664e195dee7f62b71771b302cc59bc (diff)
downloadgo-c96ac60bcdd9c3c170fd70cc1b8b5ebfcda2d776.tar.xz
time: document that going to sleep may stop the monotonic clock
Fixes #23178 Change-Id: I060a73d6263bc135f5a14c1991932a225208bb39 Reviewed-on: https://go-review.googlesource.com/103396 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/time/time.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/time/time.go b/src/time/time.go
index 6579639740..02452d1c1f 100644
--- a/src/time/time.go
+++ b/src/time/time.go
@@ -51,6 +51,10 @@
// readings. If either t or u contains no monotonic clock reading, these
// operations fall back to using the wall clock readings.
//
+// 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.
+//
// Because the monotonic clock reading has no meaning outside
// the current process, the serialized forms generated by t.GobEncode,
// t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic