We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1700ca0 commit 8a85a85Copy full SHA for 8a85a85
library/std/src/thread/mod.rs
@@ -775,6 +775,14 @@ pub fn sleep_ms(ms: u32) {
775
/// Platforms which do not support nanosecond precision for sleeping will
776
/// have `dur` rounded up to the nearest granularity of time they can sleep for.
777
///
778
+/// Currently, specifying a zero duration on Unix platforms returns immediately
779
+/// without invoking the underlying [`nanosleep`] syscall, whereas on Windows
780
+/// platforms the underlying [`Sleep`] syscall is always invoked.
781
+/// If the intention is to yield the current time-slice you may want to use
782
+/// [`yield_now`] instead.
783
+/// [`nanosleep`]: https://linux.die.net/man/2/nanosleep
784
+/// [`Sleep`]: https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-sleep
785
+///
786
/// # Examples
787
788
/// ```no_run
0 commit comments