Kernel32Sleep Method

Suspends the execution of the current thread until the time-out interval elapses.

To enter an alertable wait state, use the SleepEx(Int32, Boolean) function.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static void Sleep(
	int milliseconds
)

Parameters

milliseconds  Int32
The time interval for which execution is to be suspended, in milliseconds.

A value of zero causes the thread to relinquish the remainder of its time slice to any other thread that is ready to run.

If there are no other threads ready to run, the function returns immediately, and the thread continues execution.

A value of INFINITE (-1) indicates that the suspension should not time out.

Remarks

See Also