Great, thanks all.
That 'QueryPerformanceCounter' and 'QueryPerformanceFrequency' code of
mentalis did the trick. None of the .NET functionality I could find was
precise enough (fastest time was 0,0003 seconds).
Don't have VB2005 yet, so I couldn't try "in VB 2005, you can use
System.Diagnostics.Stopwatch". I did try:
Dim objProcessorTime As New System.Diagnostics.PerformanceCounter()
objProcessorTime.CategoryName = "Processor"
objProcessorTime.CounterName = "% Processor Time"
objProcessorTime.InstanceName = "_Total"
but wasn't precise enough.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schreef in bericht
news:OI**************@tk2msftngp13.phx.gbl...
"Qwert" <no**@nosp.com> schrieb: Debug.WriteLine("A: " & DateTime.Now.Ticks.ToString)
REM Calculate a bunch of stuff. Some loops and math functions.
Debug.WriteLine("B: " & DateTime.Now.Ticks.ToString)
but both A and B have the exact the same value. Is this method incorrect?
You may want to use this timer:
<URL:http://www.mentalis.org/soft/class.qpx?id=8>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>