Uređivanje

Dijeli putem


TimeProviderTaskExtensions Class

Definition

Provide extensions methods for Task operations with TimeProvider.

public ref class TimeProviderTaskExtensions abstract sealed
public static class TimeProviderTaskExtensions
type TimeProviderTaskExtensions = class
Public Module TimeProviderTaskExtensions
Inheritance
TimeProviderTaskExtensions

Remarks

The Microsoft.Bcl.TimeProvider library interfaces are intended solely for use in building against pre-.NET 8 surface area. If your code is being built against .NET 8 or higher, then this library should not be utilized.

Methods

CreateCancellationTokenSource(TimeProvider, TimeSpan)

Initializes a new instance of the CancellationTokenSource class that will be canceled after the specified TimeSpan.

Delay(TimeProvider, TimeSpan, CancellationToken)

Creates a task that completes after a specified time interval.

WaitAsync(Task, TimeSpan, TimeProvider, CancellationToken)

Gets a Task that will complete when this Task completes, when the specified timeout expires, or when the specified CancellationToken has cancellation requested.

WaitAsync<TResult>(Task<TResult>, TimeSpan, TimeProvider, CancellationToken)

Gets a Task that will complete when this Task completes, when the specified timeout expires, or when the specified CancellationToken has cancellation requested.

Applies to