Method DelayAsync
- Namespace
- KZDev.SystemClock.PrimeTime
- Assembly
- KZDev.SystemClock.PrimeTime.dll
DelayAsync(TimeSpan)
Creates a task that completes after a specified time interval.
Task DelayAsync(TimeSpan delayTime)
Parameters
delayTimeTimeSpanThe time span to wait before completing the returned task, or InfiniteTimeSpan to wait indefinitely.
Returns
Exceptions
- ArgumentOutOfRangeException
delayTimeis not a valid delay (for example, negative and not an infinite timeout, or too large to express in milliseconds).
DelayAsync(int)
Creates a task that completes after a specified number of milliseconds.
Task DelayAsync(int millisecondsDelay)
Parameters
millisecondsDelayintThe number of milliseconds to wait before completing the returned task, or -1 to wait indefinitely.
Returns
Exceptions
- ArgumentOutOfRangeException
millisecondsDelayis less than -1.
DelayAsync(TimeSpan, CancellationToken)
Creates a task that completes after a specified time interval.
Task DelayAsync(TimeSpan delayTime, CancellationToken cancellationToken)
Parameters
delayTimeTimeSpanThe time span to wait before completing the returned task, or InfiniteTimeSpan to wait indefinitely.
cancellationTokenCancellationTokenA cancellation token to observe while waiting for the task to complete.
Returns
Exceptions
- ArgumentOutOfRangeException
delayTimeis not a valid delay (for example, negative and not an infinite timeout, or too large to express in milliseconds).- OperationCanceledException
The operation was canceled via
cancellationToken.
DelayAsync(int, CancellationToken)
Creates a task that completes after a specified number of milliseconds.
Task DelayAsync(int millisecondsDelay, CancellationToken cancellationToken)
Parameters
millisecondsDelayintThe number of milliseconds to wait before completing the returned task, or -1 to wait indefinitely.
cancellationTokenCancellationTokenA cancellation token to observe while waiting for the task to complete.
Returns
Exceptions
- ArgumentOutOfRangeException
millisecondsDelayis less than -1.- OperationCanceledException
The operation was canceled via
cancellationToken.