File tree 1 file changed +8
-0
lines changed
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) {
775
775
/// Platforms which do not support nanosecond precision for sleeping will
776
776
/// have `dur` rounded up to the nearest granularity of time they can sleep for.
777
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
+ ///
778
786
/// # Examples
779
787
///
780
788
/// ```no_run
You can’t perform that action at this time.
0 commit comments