Collapse the table of content
Expand the table of content
Expand Minimize

wait Function


Pauses the current context for a specified amount of time.

void __cdecl wait(
   unsigned int _Milliseconds


The number of milliseconds the current context should be paused for. If the _Milliseconds parameter is set to the value 0, the current context should yield execution to other runnable contexts before continuing.

If this method is called on a Concurrency Runtime scheduler context, the scheduler will find a different context to run on the underlying resource. Because the scheduler is cooperative in nature, this context cannot resume exactly after the number of milliseconds specified. If the scheduler is busy executing other tasks that do not cooperatively yield to the scheduler, the wait period could be indefinite.


Header: concrt.h

Namespace: concurrency

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft