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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("Kernel32.dll", SetLastError := true>]
Public Shared Sub Sleep (
milliseconds As Integer
)
Dim milliseconds As Integer
Kernel32.Sleep(milliseconds)
public:
[DllImportAttribute(L"Kernel32.dll", SetLastError = true)]
static void Sleep(
int milliseconds
)
[<DllImportAttribute("Kernel32.dll", SetLastError = true)>]
static member Sleep :
milliseconds : int -> unit
No code example is currently available or this language may not be supported.
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.