I didn't look over your code because its not enclosed within code tags.
However have you considered that your program does not run continuously since its scheduled ran and rescheduled again.
gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
Clocks aren't as easy as they look. For instance, Sleep(N) gives you AT LEAST N periods of time - but note the "at least" part of that. ;)
Because other programs and lots of Windows services (programs without a terminal window for output), are running, many times you'll get more sleep time than you bargained for.
Also, you have left zero time for your program to actually run - agreed it won't need much, but surely it will need some time.
So, what to do? One way is to subtract the amount of time you get back from the system, from either a minute, or the amount that you asked for. Then adjust how much time you ask for on the next loop, to account for it (basically, subtract it).
You ask for 60 seconds, and you got 60.5 seconds. So you ask for 59.5 seconds, on your next loop. You asked for 59.5 seconds, but you got 59.7 seconds. You ask for 59.8 seconds on your next loop (because it was .2 seconds behind what you asked for last time). And continue with that type of "carry over" logic.
Adak
Nearly a Posting Virtuoso
1,479 posts since Jun 2008
Reputation Points: 425
Solved Threads: 185