I need to create some windows service which will execute every some often, every hour. The question is – which timer control should I use: System.Timers.Timer or System.Threading.Timer one? I am asking because I have been reading through the forum and I am getting a few mixed reviews on both. Also, the explanations are kind of hard to follow as I am pretty new to programming. Thank you.
Share
I use System.Timers.Timer in my Windows services. It’s easy to control and hook up. VS 2010’s Intellisense even creates the elapsed event handler as you type “myTimer.Elapsed += …”
You can also stop the timer at the beginning of your event handler and restart it at the end if you don’t want the timer firing before the event handler is finished on long-running processing. For example: