system.timer not firing

C

caulker

I have a simple Windows Service with a timer (system.timer).
The service seems to run just fine when I have the Timer = 1 minute, but
when I set the Timer = 15 minutes it only fires once ... then appears to
stop.

any help is greatly appreciated...
 
M

morgal

-----Original Message-----
I have a simple Windows Service with a timer (system.timer).
The service seems to run just fine when I have the Timer = 1 minute, but
when I set the Timer = 15 minutes it only fires once ... then appears to
stop.

any help is greatly appreciated...

Check the doc's, I've not had to play with timers for a
bit now, but I think there is a maximum time that a timer
can do, then you have to keep track of how many times it
fires for running total until you reach your max value.
 
C

caulker

yes, this appears to be the case. i didn't find any mention in the
System.Timer docs on MSDN concerning a maximum range for a timer, but
through trial and error this appears to be true...
thanks for the help...
 
R

RayO

No it's working here just fine, with the Interval set
to 5 mins. Check whether your logic is ok, especially the Interval
setting logic, and whether you're setting AutoReset to false
(should be true, the default), and whether it's getting disabled
somehow, and whether Elapsed is hooked properly.

RayO
 
R

Rutger

R

RayO

There are actually three of them. The least reliable is
the Windows one, which I don't use.

I'm using the Timers one, which works just fine, and is
more accurate and reliable than the Windows one.

There is also the Threading one, which is more lightweight
and has fewer features, and may be even more reliable.

RayO
 

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