# Scheduling with Timers This sample illustrates the use of a [.NET Timer](https://learn.microsoft.com/en-us/dotnet/api/system.threading.timer) to trigger scheduled tasks. To leverage the benefits of [NServiceBus retries](/nservicebus/recoverability/index.md) and [consistency of outgoing messages with the transport transaction](/transports/transactions.md), the tasks are implemented as regular message handlers. This also gives full traceability of the invoked tasks in platform tools like [ServicePulse](/servicepulse/index.md). ```cs var interval = TimeSpan.FromSeconds(5); var timer = new Timer(async state => { try { await messageSession.SendLocal(new MyScheduledTask()); logger.LogInformation("{Task} scheduled", nameof(MyScheduledTask)); } catch (Exception ex) { logger.LogError(ex, nameof(MyScheduledTask) + " could not be scheduled"); } }, null, interval, interval); ```