K
KnighT
I have a .net service that runs a System.Threading.Timer. The delegate
points to the function that the service should execute when the timer
elapses. Problem: The timer is not ticking.
I have never used this timer. I used the documentation from Microsoft
as a guide, but I cannot get this timer to work.
Protected Overrides Sub OnStart(ByVal args() As String)
Dim myTimer As New TimerState()
' Create the delegate that invokes methods for the timer.
Dim timerDelegate As New TimerCallback(AddressOf
checkDatabases)
' Create a timer that waits 0 seconds, then invokes every 60
seconds.
Dim timer As New Timer(timerDelegate, myTimer, 10000, 60000)
log.write("Service started ")
End Sub
The log.write("Service....") executes properly. Why is the timer not
working ?
points to the function that the service should execute when the timer
elapses. Problem: The timer is not ticking.
I have never used this timer. I used the documentation from Microsoft
as a guide, but I cannot get this timer to work.
Protected Overrides Sub OnStart(ByVal args() As String)
Dim myTimer As New TimerState()
' Create the delegate that invokes methods for the timer.
Dim timerDelegate As New TimerCallback(AddressOf
checkDatabases)
' Create a timer that waits 0 seconds, then invokes every 60
seconds.
Dim timer As New Timer(timerDelegate, myTimer, 10000, 60000)
log.write("Service started ")
End Sub
The log.write("Service....") executes properly. Why is the timer not
working ?