# SystemTarget.RegisterTimer(Func&lt;object?, Task&gt;, object?, TimeSpan, TimeSpan)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.systemtarget/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.systemtarget/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Core/SystemTarget.cs#L191-L194)

```csharp
public IGrainTimer RegisterTimer(Func<object?, Task> callback, object? state, TimeSpan dueTime, TimeSpan period)
```

Registers a timer to send regular callbacks to this system target.

### Parameters

- `callback` (`Func<object?, Task>`): The timer callback, which will fire whenever the timer becomes due.
- `state` (`object?`): The state object passed to the callback.
- `dueTime` (`TimeSpan`): The amount of time to delay before the `callback` is invoked. Specify `System.Threading.Timeout.InfiniteTimeSpan` to prevent the timer from starting. Specify `System.TimeSpan.Zero` to invoke the callback promptly.
- `period` (`TimeSpan`): The time interval between invocations of `callback`. Specify `System.Threading.Timeout.InfiniteTimeSpan` to disable periodic signaling.

### Returns

An `System.IDisposable` object which will cancel the timer upon disposal.
