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

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.grain/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.grain/methods/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Core.Abstractions/Core/Grain.cs#L103-L108)

```csharp
[System.Obsolete(Use 'this.RegisterGrainTimer(callback, state, new() { DueTime = dueTime, Period = period, Interleave = true })' instead.)]
protected IDisposable RegisterTimer(Func<object?, Task> callback, object? state, TimeSpan dueTime, TimeSpan period)
```

Registers a timer to send periodic callbacks to this grain.

### Parameters

- `callback` (`Func<object?, Task>`): Callback function to be invoked when timer ticks.
- `state` (`object?`): State object that will be passed as argument when calling the `callback`.
- `dueTime` (`TimeSpan`): Due time for first timer tick.
- `period` (`TimeSpan`): Period of subsequent timer ticks.

### Returns

Handle for this timer.
