TaskUtilities..::..DelaySafe Method (TimeSpan, CancellationToken)
Creates a cancellable task that completes after a specified time interval. This will not throw an exception if the cancellationToken is triggered or disposed.
Namespace:
Tortuga.AnchorAssembly: Tortuga.Anchor (in Tortuga.Anchor.dll)
Syntax
public static Task DelaySafe( TimeSpan delay, CancellationToken cancellationToken )
Public Shared Function DelaySafe ( _ delay As TimeSpan, _ cancellationToken As CancellationToken _ ) As Task
Parameters
- delay
- Type: TimeSpan
The time span to wait before completing the returned task, or TimeSpan.FromMilliseconds(-1) to wait indefinitely.
- cancellationToken
- Type: CancellationToken
A cancellation token to observe while waiting for the task to complete.