LocationMy.Computer.Clock.TickCount SyntaxDim result As Integer = My.Computer.Clock.TickCount DescriptionThe TickCount property returns the current millisecond count of the system timer, although with limited granularity. Usage at a Glance
ExampleThe following example returns the number of milliseconds that have elapsed since the last time the function was called. Public Function SinceLastCall( ) As Integer ' ----- Return the number of milliseconds since the ' last call of this routine. Static lastTime As Integer = -1 Dim thisTime As Integer ' ----- Get the current tick count and compare to last time. thisTime = My.Computer.Clock.TickCount If (lastTime = -1) Then lastTime = thisTime If (thisTime < lastTime) Then ' ----- The integer value wrapped. SinceLastCall = (Integer.MaxValue - lastTime) + _ (thisTime - Integer.MinValue) Else ' ----- Simple advance of the timer. SinceLastCall = thisTime - lastTime End If lastTime = thisTime End Function Related Framework Entries
See AlsoClock Object, GmtTime Property, LocalTime Property |