Task::Delay Method (TimeSpan)
Creates a task that completes after a specified time interval.
Assemblies: System.Threading.Tasks (in System.Threading.Tasks.dll)
mscorlib (in mscorlib.dll)
- Type: System::TimeSpan
The time span to wait before completing the returned task, or TimeSpan.FromMilliseconds(-1) to wait indefinitely.
Return ValueType: System.Threading.Tasks::Task
A task that represents the time delay.
After the specified time delay, the task is completed in TaskStatus::RanToCompletion state.
For usage scenarios and additional examples, see the documentation for the Delay(Int32) overload.
This method depends on the system clock. This means that the time delay will approximately equal the resolution of the system clock if the delay argument is less than the resolution of the system clock, which is approximately 15 milliseconds on Windows systems.