Table of Contents

Method DelayAsync

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

DelayAsync(Duration)

Asynchronously completes after the specified NodaTime.Duration.

public Task DelayAsync(Duration duration)

Parameters

duration Duration

The duration to wait before the operation completes.

Returns

Task

Remarks

Implementations may clamp values: zero or negative is treated as zero; durations greater than MaxValue are clamped to MaxValue for the underlying delay.

DelayAsync(Duration, CancellationToken)

Asynchronously completes after the specified NodaTime.Duration, or ends early when cancellationToken is cancelled.

public Task DelayAsync(Duration duration, CancellationToken cancellationToken)

Parameters

duration Duration

The duration to wait before the operation completes.

cancellationToken CancellationToken

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

Returns

Task

Remarks

Implementations may clamp values: zero or negative is treated as zero; durations greater than MaxValue are clamped to MaxValue for the underlying delay.

Exceptions

OperationCanceledException

The operation was canceled via cancellationToken.

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.