Condividi tramite


SystemTarget.RegisterTimer Metodo

Definizione

Registra un timer per inviare i callback regolari a questo granularità. Questo timer mantiene disattivato il granularità corrente.

public IDisposable RegisterTimer (Func<object,System.Threading.Tasks.Task> asyncCallback, object state, TimeSpan dueTime, TimeSpan period, string name = default);
member this.RegisterTimer : Func<obj, System.Threading.Tasks.Task> * obj * TimeSpan * TimeSpan * string -> IDisposable
Public Function RegisterTimer (asyncCallback As Func(Of Object, Task), state As Object, dueTime As TimeSpan, period As TimeSpan, Optional name As String = Nothing) As IDisposable

Parametri

asyncCallback
Func<Object,Task>

Callback timer, che verrà generato ogni volta che il timer diventa dovuto.

state
Object

Oggetto state passato al callback.

dueTime
TimeSpan

Quantità di tempo in base a cui ritardare la chiamata di asyncCallback. Specificare InfiniteTimeSpan per impedire l'avvio del timer. Specificare Zero per richiamare tempestivamente il callback.

period
TimeSpan

Intervallo di tempo tra le chiamate di asyncCallback. Specificare per disabilitare InfiniteTimeSpan la segnalazione periodica.

name
String

Nome timer.

Restituisce

Oggetto IDisposable che annulla il timer a disposizione.

Si applica a