---
title: "Discussion on \"PeriodicTimer(the new async timer from .NET 6)\" | Hashnode"
description: "Discussion on \"PeriodicTimer(the new async timer from .NET 6)\". 在.NET 6 中引入了新 Timer：System.Threading.PeriodicTimer，它和之前的 Timer 相比，最大的区别就是新的 PeriodicTimer 事件处理可以方便地使用异步，消除使用 callback 机制减少使用复杂度。讲解 PeriodicTimer 之前我们先来看以下该怎么使用它：\nusing var cts = new CancellationTokenSource();\nConsole.CancelKeyPress += (sender, e) =>\n..."
url: "https://hashnode.com/posts/periodictimerthe-new-async-timer-from-net-6/65a62368d072a12008cd80c0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [PeriodicTimer(the new async timer from .NET 6)](https://docs.inorah.xyz/periodictimerthe-new-async-timer-from-net-6?utm_source=hashnode&utm_medium=feed)

在.NET 6 中引入了新 Timer：System.Threading.PeriodicTimer，它和之前的 Timer 相比，最大的区别就是新的 PeriodicTimer 事件处理可以方便地使用异步，消除使用 callback 机制减少使用复杂度。讲解 PeriodicTimer 之前我们先来看以下该怎么使用它： using var cts = new CancellationTokenSource(); Console.CancelKeyPress += (sender, e) => ...

Jan 16, 2024 · 2 min read · docs.inorah.xyz  
Read the article

-   [#periodictimer](https://hashnode.com/tag/periodictimer)
-   [#net](https://hashnode.com/tag/net)
-   [#timer](https://hashnode.com/tag/timer)

## Written by

[shiney](https://hashnode.com/@eddychu)

@eddychu

  
[View profile](https://hashnode.com/@eddychu)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
