Question Best Timer for the job

stulish

Well-known member
Joined
Jun 6, 2013
Messages
61
Programming Experience
3-5
I have created a program that needs to compress all the data in a directory and save it to 3 different locations, i have completed this with help from you guys and it is working pretty good, but i have found a small item i am trying to iron out.

When the program starts it waits until the datetime.now.seconds = 10 and then starts a forms.timer with an interval of 60000

this all works great but what i have found over hours (12hrs+) the time creeps; after looking into it the forms.timer counts on completion of the code that is run within its proceedure, is there a better type of timer that will fire every 60 seconds and not creep?

I did read the System.Timers.timer and also the threading but didn't really understand if they would accomplish what i want.

Thanks

Stu
 
The work is basically taking in lots of data from data collection equipments and then saving to a temporary location, each text file holding the recorded data is saved in a temporary location and once every minute the data is zipped into a local directory and the original text file is deleted, the zipped file is then also copied to a network hard drive as a back up, the program needs to run for weeks (typically 4-8) without the creep i mentioned before.

I have now used a system.timers.timer and it all seems to be working fine, with no creep, after 12 hours of running.

Thanks
Stu
 
Back
Top