I quickly wrote this little rinky-dink vb.net console app to demonstrate something to someone. When I got to looking at it I thought there must be a better way than eating up cycles by using
While True
...
End While
but I have no idea what it is. Any thoughts?
Module ControlExecutive
Private WithEvents MyTimer As New Timers.Timer
Sub Main()
MyTimer.Interval = 10000
Console.WriteLine("Start timer, interrupt every 10000 ms")
MyTimer.Start()
OuterLoop()
End Sub
Sub OuterLoop()
While True
'wait for timer interrupts
End While
End Sub
Sub HandleTimerInterrupt(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles MyTimer.Elapsed
Console.WriteLine(String.Format("Interrupt at {0}", DateTime.Now))
End Sub
End Module