Re: Timer used in Windows Services

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Andrew wrote:
I am programming a Windows Service using .net 2005. In this service, I need a timer to check file status in a predefined interval. However, as you may have experienced by yourself or read through internet, the System.Timers.Timer() is not reliable: The timer event may not be fired at all sometimes.

Any good/reliable solutions/approaches for this? Thanks a lot.

The only problem I've read about with respect to any timer problems in ..NET is a timer that has been configured to repeat, and which has been left running for an extended period of time (I don't recall the specifics, but "49 days" seems to pop into my head for some reason).

If your application is one that might be affected by this, my understanding is that simply changing the timer usage so that you reset the timer each time it is signaled, and start it again with a new interval, it works fine.

If you expect there to be a problem, my suggestion is that you first reproduce the problem in your own code. Then you will have a better idea of whether it's really a problem, and you will be able to ensure that you have satisfactorily worked around the problem.

Pete
.



Relevant Pages

  • Re: Looking for a way to power off & on a small appliance via telephone
    ... power of a small device that has caused his internet ... having a device with a timer attached that will cycle power off and then on when the timer times out, unless the timer gets restarted before timeout. ... And then add a feature in the Internet Service program that will periodically restart the timer unless it has failed. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Looking for a way to power off & on a small appliance via telephone
    ... power of a small device that has caused his internet ... having a device with a timer attached that will cycle power off and then on when the timer times out, unless the timer gets restarted before timeout. ... (Avoids phone calls in the middle of the night). ...
    (borland.public.delphi.thirdpartytools.general)
  • RE: timer
    ... > I am using a query to retrieve data from the Internet and need to build in a ... > timer to wait for the remote server to reset. ...
    (microsoft.public.excel.programming)
  • Re: Clock time settings IPAQ
    ... this happens out of the cradle, not connected to the internet, with a ... timer of 1 minute of being inactive....I shut it off and it comes back ... Prev by Date: ...
    (microsoft.public.pocketpc)
  • timer
    ... I am using a query to retrieve data from the Internet and need to build in a ... timer to wait for the remote server to reset. ...
    (microsoft.public.excel.programming)