Hello Guys,
I need some help in vb programming.
I need to call a function in my application per 5 minutes
(or some other period). How can I do that?
Printable View
Hello Guys,
I need some help in vb programming.
I need to call a function in my application per 5 minutes
(or some other period). How can I do that?
I think from memory Timer controls will let you fire off an event every n milliseconds where 0 < n <= 60000. IN other words, one minute is the most you can get.
So you simply have a module variable in your code or even a static var in your timer event to record how many lots of one minute have passed.
Have you ever seen or used the timer control before?
Regards
Paul Lewis
Try this
http://forums.vb-world.net/showthrea...threadid=20868
This question has been asked lots of times, you should try a search of the forum!
Depends on what your program is designed to do...but you can use the sleep API.
But if you want other things to continue on while the program waits the five minutes you would have to use a timer like Paul suggested.Code:Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
'Then this will put the program to sleep for 5 minutes.
Sleep 300000
Gl,
D!m
I wnat other things to continue. So I prefer using the
timer, like Paul suggested. But I never used timer control
before, how to use it, and what is the module variable?
Thanks a lot for your answer.
not exactly alice in wonderland but if you follow the link that Paul Dwyer placed in his reply, you should see plenty of examples on how to solve your problem.
Regards
Paul Lewis
Yes,I got it.
Thank you very much.