Skip to content

Commit 2f89c41

Browse files
committed
Auto merge of rust-lang#116157 - the8472:doc-monotonoic-suspend, r=Mark-Simulacrum
Document that Instant may or may not include system-suspend time Since people are still occasionally surprised by this let's make it more explicit. This doesn't add any new guarantees, only documents the status quo. Related issues: rust-lang#87906 rust-lang#79462
2 parents bb6c66b + b0412d5 commit 2f89c41

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/std/src/time.rs

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ pub use core::time::TryFromFloatSecsError;
5858
/// some seconds may be longer than others). An instant may jump forwards or
5959
/// experience time dilation (slow down or speed up), but it will never go
6060
/// backwards.
61+
/// As part of this non-guarantee it is also not specified whether system suspends count as
62+
/// elapsed time or not. The behavior varies across platforms and rust versions.
6163
///
6264
/// Instants are opaque types that can only be compared to one another. There is
6365
/// no method to get "the number of seconds" from an instant. Instead, it only

0 commit comments

Comments
 (0)