Clarify difference between unix/windows behaviour
Updated to specify the underlying syscalls
This commit is contained in:
parent
1700ca07c6
commit
8a85a85cea
1 changed files with 8 additions and 0 deletions
|
@ -775,6 +775,14 @@ pub fn sleep_ms(ms: u32) {
|
||||||
/// Platforms which do not support nanosecond precision for sleeping will
|
/// Platforms which do not support nanosecond precision for sleeping will
|
||||||
/// have `dur` rounded up to the nearest granularity of time they can sleep for.
|
/// have `dur` rounded up to the nearest granularity of time they can sleep for.
|
||||||
///
|
///
|
||||||
|
/// Currently, specifying a zero duration on Unix platforms returns immediately
|
||||||
|
/// without invoking the underlying [`nanosleep`] syscall, whereas on Windows
|
||||||
|
/// platforms the underlying [`Sleep`] syscall is always invoked.
|
||||||
|
/// If the intention is to yield the current time-slice you may want to use
|
||||||
|
/// [`yield_now`] instead.
|
||||||
|
/// [`nanosleep`]: https://linux.die.net/man/2/nanosleep
|
||||||
|
/// [`Sleep`]: https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-sleep
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue