Archived

This topic is now archived and is closed to further replies.

How would you do this

This topic is 5625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am writing a program scheduler for work, I think I know how I am going to handle the timeing, but just wanted to see if there is a better way. What I am planning to do is use the windows timer and set it to fire at the time I need something to run. The only problem with this is that I don''t know how much I can depend on the timer to remember to fire after 24 hours. Aside from setting the timer to fire every minute and checking to see if anything needs to be run at that time, is there another way of doing this? Jason Mickela ICQ : 873518 Excuse my speling. The V-Town Have-Nots

Share this post


Link to post
Share on other sites
quote:
Original post by griffenjam
Aside from setting the timer to fire every minute and checking to see if anything needs to be run at that time, is there another way of doing this?

Unless you have specific needs, use the Windows Scheduler.

If that doesn''t work, the Windows timer is just fine. You don''t need an incredible amount of accuracy. If 24-hour rollover is an issue, you could have the scheduler spawned by a separate process :basically the spawning proc would check for the existence of, say, a named mutex and spawn your scheduler in the absence of said mutex. Your scheduler, naturally, would create the mutex when it starts and destroy/release it when it shuts down. Now your scheduler can run for shorter segments (<24hr) and automatically be restarted. Remember to also lower its priority.

Share this post


Link to post
Share on other sites