File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -775,6 +775,14 @@ pub fn sleep_ms(ms: u32) {
775775/// Platforms which do not support nanosecond precision for sleeping will
776776/// have `dur` rounded up to the nearest granularity of time they can sleep for.
777777///
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+ ///
778786/// # Examples
779787///
780788/// ```no_run
You can’t perform that action at this time.
0 commit comments