Table of Contents

Method DelayAsync

Namespace
KZDev.SystemClock.PrimeTime.Testing
Assembly
KZDev.SystemClock.PrimeTime.Testing.dll

DelayAsync(TimeSpan)

Creates a task that completes after a specified time interval.

public Task DelayAsync(TimeSpan delayTime)

Parameters

delayTime TimeSpan

The time span to wait before completing the returned task, or InfiniteTimeSpan to wait indefinitely.

Returns

Task

Exceptions

ArgumentOutOfRangeException

delayTime is 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.

public Task DelayAsync(int millisecondsDelay)

Parameters

millisecondsDelay int

The number of milliseconds to wait before completing the returned task, or -1 to wait indefinitely.

Returns

Task

Exceptions

ArgumentOutOfRangeException

millisecondsDelay is less than -1.

DelayAsync(TimeSpan, CancellationToken)

Creates a task that completes after a specified time interval.

public Task DelayAsync(TimeSpan delayTime, CancellationToken cancellationToken)

Parameters

delayTime TimeSpan

The time span to wait before completing the returned task, or InfiniteTimeSpan to wait indefinitely.

cancellationToken CancellationToken

A cancellation token to observe while waiting for the task to complete.

Returns

Task

Exceptions

ArgumentOutOfRangeException

delayTime is 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.

public Task DelayAsync(int millisecondsDelay, CancellationToken cancellationToken)

Parameters

millisecondsDelay int

The number of milliseconds to wait before completing the returned task, or -1 to wait indefinitely.

cancellationToken CancellationToken

A cancellation token to observe while waiting for the task to complete.

Returns

Task

Exceptions

ArgumentOutOfRangeException

millisecondsDelay is less than -1.

OperationCanceledException

The operation was canceled via cancellationToken.