I've got the timer blues

  • Thread starter Thread starter Adam Benson
  • Start date Start date
A

Adam Benson

Hi,

We have figured out that System.Timers.Timer should be avoided because it
occasionally stops firing.

So, we dutifully began switching over to System.Threading.Timer but somebody
at work now says that System.Threading.Timer can also be unreliable.

Could somebody in the know please tell me : is System.Threading.Timer
reliable or not?

Thanks,

Adam.
 
The System.Timers.Timer in the .Net Framework 1.1 has a bug in it, which
causes it to stop raising the Elapsed event when Stop is called on it. This
is not the case, however, in the .Net Framework 2.0. If using the .Net
Framework 1.1, try using a System.Threading.Timer instead.

The System.Timers.Timer will stop firing after something beyond 40 days (I
don't have it in front of me), but it is a simple matter to re-create it
from time to time within that time period. For example, in the handler for
the Elapsed event. It is not necessary to re-create it every time, but only
within that time interval.

--
HTH,

Kevin Spencer
Microsoft MVP
Logostician
http://unclechutney.blogspot.com

Parabola is a mate of plane.
 

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

Back
Top