Why there are 5 Versions of Timer Classes in .NET?

后端 未结 2 882
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 06:29

Why are there five timer classes in the .Net framework, namely the following:

  1. System.Timers.Timer
  2. System.Threading.Timer
2条回答
  •  离开以前
    2020-11-28 07:13

    Timers.Timer generates an event after a set interval, with an option to generate recurring events. MSDN

    Windows.Forms.Timer is a Control for winforms.

    Web.UI.Timer performs asynchronous or synchronous Web page postbacks at a defined interval. MSDN

    Threading.Timer is the timer for Callbacks. Creates a new Thread for working. Served by thread pool threads. MSDN

    So, these timers have different purposes, also they are served by different tools.

提交回复
热议问题