Hi
I have implemented a timer in VB .NET so that a piece of code is executed at regular intervals. This works fine, apart from the fact that the code is not executed until the first interval has elapsed. As this interval is quite large (several hours) it means that the code is not executed within the first hours after the application is started..
This is the code:
Can I manually trigger the "TimerMethod" procedure once before starting the timer?
I have implemented a timer in VB .NET so that a piece of code is executed at regular intervals. This works fine, apart from the fact that the code is not executed until the first interval has elapsed. As this interval is quite large (several hours) it means that the code is not executed within the first hours after the application is started..
This is the code:
Code:
Dim MyTimer As New System.Timers.Timer()
AddHandler MyTimer.Elapsed, AddressOf TimerMethod
MyTimer.Interval = 43200000
MyTimer.Start()
Can I manually trigger the "TimerMethod" procedure once before starting the timer?