Is there a timer class in C# that isn't in the Windows.Forms namespace?

后端 未结 6 1306

I want to use a timer in my simple .NET application written in C#. The only one I can find is the Windows.Forms.Timer class. I don\'t want to reference this namespace just f

6条回答
  •  佛祖请我去吃肉
    2020-12-30 03:57

    System.Timers.Timer

    And as MagicKat says:

    System.Threading.Timer

    You can see the differences here: http://intellitect.com/system-windows-forms-timer-vs-system-threading-timer-vs-system-timers-timer/

    And you can see MSDN examples here:

    http://msdn.microsoft.com/en-us/library/system.timers.timer(VS.80).aspx

    And here:

    http://msdn.microsoft.com/en-us/library/system.threading.timer(VS.80).aspx

提交回复
热议问题