Timers in System Services

G

GaryDean

I need to use timers in a system service I am writing. I've been googling
around and read that there are problems. Some say we can simply drop a
timer on the design service with no problems and other say that is
problematic.

Is there a reccomended way in which to deal with timers in services?
Thanks
Gary
 
H

Henning Krause [MVP - Exchange]

Hi,

I've never encountered any issues using System.Timers.Timer or
System.Threading.Timer (the latter one being somewhat lowerlevel than the
first one).

Kind regards,
Henning Krause
 
S

Steven Cheng

Hi Gary,

As for Timers, only if you're developing winform and want to use it in GUI
code. Otherwise, you're always recommended to use the System.Timers.Timer
or Threading.Timer. Here is a former article discussing on the different
timers:

#Comparing the Timer Classes in the .NET Framework Class Library
http://msdn.microsoft.com/en-us/magazine/cc164015.aspx

also, Jeffrey Richter's CLR via C# (.net 2.0) also has a threading chapter
discussing on the use of timer class.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top