In short, does anyone know how to use VB to measure times of less then .01 seconds?
In detail, I am trying to time an event that takes .001 - .009 seconds. The best resolution that I seem to be able to get is .01 seconds. I have reviewed the archives and found thread222-6546 . This was helpful in that it created a timer that doesn't reset itself but every 47 days, but it didn't help my problem. To test for accuracy I created a form with four text boxes, one command button and the following code:
By inputting different values into Text4 I could see how accurate GetTickCount is and the actual values returned. It seems that it is accurate to .01 seconds and it always round up.
Does anyone know how to use VB to measure times of less then .01 seconds?
In detail, I am trying to time an event that takes .001 - .009 seconds. The best resolution that I seem to be able to get is .01 seconds. I have reviewed the archives and found thread222-6546 . This was helpful in that it created a timer that doesn't reset itself but every 47 days, but it didn't help my problem. To test for accuracy I created a form with four text boxes, one command button and the following code:
Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function GetTickCount& Lib "kernel32" ()
Private Sub Command1_Click()
Text2 = GetTickCount
Sleep Text4
Text1 = GetTickCount
Text3 = Text1 - Text2
End Sub
Does anyone know how to use VB to measure times of less then .01 seconds?