ITimer Interface

Definition

Represents a timer that can have its due time and period changed.

C#
public interface ITimer : IAsyncDisposable, IDisposable
Derived
Implements

Remarks

Implementations of Change(TimeSpan, TimeSpan), Dispose(), and DisposeAsync() must all be thread-safe such that the timer instance may be accessed concurrently from multiple threads.

Methods

Change(TimeSpan, TimeSpan)

Changes the start time and the interval between method invocations for a timer, using TimeSpan values to measure time intervals.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from IDisposable)
DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

(Inherited from IAsyncDisposable)

Extension Methods

ConfigureAwait(IAsyncDisposable, Boolean)

Configures how awaits on the tasks returned from an async disposable will be performed.

Applies to

Toode Versioonid
.NET 8, 9, 10
.NET Standard 2.0 (package-provided)