BatchingLoggerProvider.IntervalAsync(TimeSpan, CancellationToken) 方法

定義

等待指定的 TimeSpanWait for the given TimeSpan.

protected:
 virtual System::Threading::Tasks::Task ^ IntervalAsync(TimeSpan interval, System::Threading::CancellationToken cancellationToken);
protected virtual System.Threading.Tasks.Task IntervalAsync (TimeSpan interval, System.Threading.CancellationToken cancellationToken);
abstract member IntervalAsync : TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.IntervalAsync : TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task

參數

interval
TimeSpan

要等候的時間量。The amount of time to wait.

cancellationToken
CancellationToken

可用來取消延遲的 CancellationTokenA CancellationToken that can be used to cancel the delay.

傳回

Task,該項目會在經過 intervalcancellationToken 取消時完成。A Task which completes when the interval has passed or the cancellationToken has been canceled.

適用於