ActiveX: SLHiResTimer
(Filename: SLHIRTIM.OCX) The SLHiResTimer ActiveX component is a high-resolution timer. The resolution of the default Timer control that comes with Visual Basic is 55 milliseconds but with SLHiResTimer you will have a resolution of one microsecond (0.000001 seconds). If you need to measure times with high accuracy you can use this control to achive it. SLHiResTimer uses the QueryPerformanceCounter high-resolution performance counter function in Windows API to get the high accuracy. Some older hardware do not support high-resolution performance counters, but all modern computer systems have support for these kind of counters. Methods
Example Private Sub CommandStart_Click() ' Start SLHiResTimer1.Start Label1 = "Has started!" End Sub Private Sub CommandRead_Click() ' Read elapsed time Dim X As Long X = SLHiResTimer1.GetElapsedTime() Label1 = "Time so far: " + CStr(X) + " microseconds." End Sub < Go back |