We run into a strange problem...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We run into a strange problem...
Here's the flow:
* we need to perform a certain action at a certain hour;
* an object of the type System.Timers.Timer is created, with its Interval
set in the following way:

TimeSpan intervalToStart = startTime - dtNow;
interval = Math.Ceiling(intervalToStart.TotalMilliseconds);

In the logs we see the value being calculated correctly.
So far, all is fine... until ~1.5 sec BEFORE the time the timer should fire.
It fires just ~1.5 sec before the estimated time (notice, some tens of
milliseconds could be explainable, but more than a second?!)

Is it a known flaw in this timers mechanism? Any suggestions?

Please advice...
 
Why not set up the process to run using one of the built in Windows
schedulers, like at.exe?

Not sure about a flaw in the Timers.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
If you are running you app and depending on the timer, you are forcing you
app to run and eat into the CPU processing. You'r app is continuously running
in the background, to be on the safer side, I do encourage you to use the
windows built in scheduler.
There was some murmuring regarding the timers in my prev. office, but sorry
I am not sure either..
Hths..
R. Thomas
 
If you are running you app and depending on the timer, you are forcing you
app to run and eat into the CPU processing. You'r app is continuously running
in the background, to be on the safer side, I do encourage you to use the
windows built in scheduler.
There was some murmuring regarding the timers in my prev. office, but sorry
I am not sure either..
Hths..
R. Thomas
 
Back
Top