Table of Contents

Interface IPrimeTime

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

The interface for the PrimeTime library for time passing and timer services. Implementations may clamp very large or out-of-range values for sleep, delay, and time-based cancellation; see the implementing type for specific limits. Members that delegate to the BCL may throw the same exceptions as the corresponding Thread, Task, or CancellationTokenSource APIs.

public interface IPrimeTime
Extension Methods

Methods

DelayAsync(int)

Creates a task that completes after a specified number of milliseconds.

DelayAsync(int, CancellationToken)

Creates a task that completes after a specified number of milliseconds.

DelayAsync(TimeSpan)

Creates a task that completes after a specified time interval.

DelayAsync(TimeSpan, CancellationToken)

Creates a task that completes after a specified time interval.

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.

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.

LinkTimeCancellationToken(int, CancellationToken)

Returns a disposable wrapper whose token is cancelled when either the specified time elapses or the given cancellation token is cancelled. Disposing the returned instance disposes all underlying sources (including internal time-based sources). The caller is responsible for disposing the returned instance when no longer needed.

LinkTimeCancellationToken(int, CancellationToken, CancellationToken)

Returns a disposable wrapper whose token is cancelled when the specified time elapses or any of the given tokens is cancelled. Disposing the returned instance disposes all underlying sources (including internal time-based sources). The caller is responsible for disposing the returned instance when no longer needed.

LinkTimeCancellationToken(int, params CancellationToken[])

Returns a disposable wrapper whose token is cancelled when the specified time elapses or any of the given tokens is cancelled. Disposing the returned instance disposes all underlying sources (including internal time-based sources). The caller is responsible for disposing the returned instance when no longer needed.

LinkTimeCancellationToken(TimeSpan, CancellationToken)

Returns a disposable wrapper whose token is cancelled when either the specified time elapses or the given cancellation token is cancelled. Disposing the returned instance disposes all underlying sources (including internal time-based sources). The caller is responsible for disposing the returned instance when no longer needed.

LinkTimeCancellationToken(TimeSpan, CancellationToken, CancellationToken)

Returns a disposable wrapper whose token is cancelled when the specified time elapses or any of the given tokens is cancelled. Disposing the returned instance disposes all underlying sources (including internal time-based sources). The caller is responsible for disposing the returned instance when no longer needed.

LinkTimeCancellationToken(TimeSpan, params CancellationToken[])

Returns a disposable wrapper whose token is cancelled when the specified time elapses or any of the given tokens is cancelled. Disposing the returned instance disposes all underlying sources (including internal time-based sources). The caller is responsible for disposing the returned instance when no longer needed.

Sleep(int)

Suspends the current thread for the specified number of milliseconds.

Sleep(TimeSpan)

Suspends the current thread for the specified amount of time.