Table of Contents

Interface IPrimeTime

Namespace
KZDev.PrimeTime
Assembly
KZDev.PrimeTime.dll

Extends IPrimeTime with NodaTime-based "now" APIs so callers can obtain current time from the clock abstraction using NodaTime.Instant, NodaTime.LocalDateTime, NodaTime.ZonedDateTime, NodaTime.LocalTime, and NodaTime.LocalDate.

public interface IPrimeTime
Extension Methods

Methods

DelayAsync(Duration)

Asynchronously completes after the specified NodaTime.Duration.

DelayAsync(Duration, CancellationToken)

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

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(Duration)

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

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(Duration, CancellationToken)

Returns a disposable wrapper whose token is cancelled when either the specified duration elapses or the given cancellation token is cancelled. The caller is responsible for disposing the returned instance when no longer needed.

LinkTimeCancellationToken(Duration, CancellationToken, CancellationToken)

Returns a disposable wrapper whose token is cancelled when the specified duration elapses or any of the given tokens is cancelled. The caller is responsible for disposing the returned instance when no longer needed.

LinkTimeCancellationToken(Duration, params CancellationToken[])

Returns a disposable wrapper whose token is cancelled when the specified duration elapses or any of the given tokens is cancelled. 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(Duration)

Suspends the current thread for the specified NodaTime.Duration.

Sleep(int)

Suspends the current thread for the specified number of milliseconds.

Sleep(TimeSpan)

Suspends the current thread for the specified amount of time.