H
Howard Kaikow
In VB, I've developed the habit of using the API QueryPerformanceCounter to
achieve the most accurate timings.
In VB .NET, one can use TotalMilliseconds and Ticks to convert time to
milliseconds.
Is this as accurate as using the QueryPerformanceCounter?
What is the resolution of Now in VB .NET?
For example:
Dim datEnd As Date
Dim datStart As Date
datStart = Now
' Do stuff here
datEnd = Now
MsgBox((datEnd.Ticks - datStart.Ticks) / 10000 & " milliseconds(Ticks)" &
vbCrLf & _
datEnd.Subtract(datStart).TotalMilliseconds.ToString() & "
milliseconds(Subtract)")
achieve the most accurate timings.
In VB .NET, one can use TotalMilliseconds and Ticks to convert time to
milliseconds.
Is this as accurate as using the QueryPerformanceCounter?
What is the resolution of Now in VB .NET?
For example:
Dim datEnd As Date
Dim datStart As Date
datStart = Now
' Do stuff here
datEnd = Now
MsgBox((datEnd.Ticks - datStart.Ticks) / 10000 & " milliseconds(Ticks)" &
vbCrLf & _
datEnd.Subtract(datStart).TotalMilliseconds.ToString() & "
milliseconds(Subtract)")