The PeriodicTimer is a .NET class that enables waiting asynchronously for timer ticks. It was introduced in .NET 6.
- Documentation:
PeriodicTimer
- API proposal on GitHub: Modern Timer API
- Article: A New Modern Timer API In .NET 6 - PeriodicTimer
Unlike most other timer-like .NET components that have a minimum timespan of TimeSpan.Zero
, the PeriodicTimer.WaitForNextTickAsync
method has a minimum timespan of 1 millisecond (citation).