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.
Private Sub CommandStart_Click() ' Start
Label1 = "Has started!"
Private Sub CommandRead_Click() ' Read elapsed time
Dim X As Long
X = SLHiResTimer1.GetElapsedTime()
Label1 = "Time so far: " + CStr(X) + " microseconds."
< Go back