Skip to content

Commit c96ac60

Browse files
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 <[email protected]>
1 parent 8618112 commit c96ac60

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/time/time.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
// readings. If either t or u contains no monotonic clock reading, these
5252
// operations fall back to using the wall clock readings.
5353
//
54+
// On some systems the monotonic clock will stop if the computer goes to sleep.
55+
// On such a system, t.Sub(u) may not accurately reflect the actual
56+
// time that passed between t and u.
57+
//
5458
// Because the monotonic clock reading has no meaning outside
5559
// the current process, the serialized forms generated by t.GobEncode,
5660
// t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic

0 commit comments

Comments
 (0)