i need timer interval more than 1 Minute.

R

Ross Ylitalo

How about something like:

Sub Main()

Dim datStart As Date


myTimer.Interval = 10000 ' every 10 seconds
datStart = DateTime.Now()
Private Sub myTimer_Timer()
If DateTime.Now().SubTract(datStart).Minutes > 1 Then
datStart = DateTime.Now()
RunFunction()
End If
End Sub

End Sub
 
H

Hapticz

wholly agreed that the timer is not that exact or relaible. if you set interval to 1 second (1000 ms), then there are 60 intervals
to accumulate error and mishaps. over a few hours or days it adds up.

ken's use of datedif is so much more solid and relies on the system clock, often one that is synched with external servers nowadays.
and less affected by code interrupts.

short run programs (on the spot office stuff) may be suitable for less exact synched code, but with most stuff now related to
internet and multiple user/client/server interaction, i would recommend Ken's suggestion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top