Table of Contents

Method GetTimeCancellationToken

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

GetTimeCancellationToken(TimeSpan)

Returns a disposable wrapper whose token expires after the specified time. The caller is responsible for disposing the returned instance when no longer needed.

public TimeCancellationTokenSource GetTimeCancellationToken(TimeSpan cancelTime)

Parameters

cancelTime TimeSpan

The time to wait before cancelling the token.

Returns

TimeCancellationTokenSource

A TimeCancellationTokenSource that will cancel after the specified time. Caller must dispose.

Exceptions

ArgumentOutOfRangeException

cancelTime is not a valid delay (for example, negative and not an infinite timeout, or too large to express in milliseconds).

GetTimeCancellationToken(int)

Returns a disposable wrapper whose token expires after the specified time. The caller is responsible for disposing the returned instance when no longer needed.

public TimeCancellationTokenSource GetTimeCancellationToken(int cancelMilliseconds)

Parameters

cancelMilliseconds int

The number of milliseconds to wait before cancelling the token.

Returns

TimeCancellationTokenSource

A TimeCancellationTokenSource that will cancel after the specified time. Caller must dispose.

Exceptions

ArgumentOutOfRangeException

cancelMilliseconds is less than -1.