Just a bit of advice about timers.
I have an event I want to fire aprox every minute, so have put this on an a windows.form timer with an interval of 60000.
I then have other events I want to fire at specific times, so I put this on a System.Timers.Timer with the SynchronizingObject set to none.
I then fire the events at the correct times like so
VB Code:
curmin = Minute(Now()) If curmin = 0 Then curhour = Hour(Now()) If curhour = 0 Then curday = Weekday(Now()) End If End If Select Case curhour Case 8 If curmin = 1 Then deloldmes() End If If curmin = 21 Then gettftp(1) End If If curmin = 56 Then getttp(2) End If Case 9 If curmin = 1 Then getmonmes() deloldmes() End If Case 10 . . . end select
I assume I have to be careful because in theory the two timers could fire at the same time so access the same procedures. Is this the only thing I need worry about and is this the correct way of doing what I'm doing?
Cheers




Reply With Quote