Fine-grained timer for measuring VBScript performance

I am doing some performance measurements in VBScript. I want to measure how fast my algorithm works

t1 = Now()  
doAlotOfWork ()  
t2 = Now()  
MsgBox "Operation took " & DateDiff ("s", t1, t2)  & " seconds."

It gives me time in seconds. If one algorithm leads to 1 second of execution, and the other after 2 seconds, this is unlikely to give me useful information. I need to blow up the size of the problem before it takes a minute to complete.

Does anyone know a way to make such measurements in VBScript, but then finer-grained. Something that introduces milliseconds, for example.

I have a feeling that there should be a solution in WMI.

+5
source share
2 answers

VBScript Timer, :

, 12:00 AM.

+7

HP QuickTest Pro, , :

( ),

MercuryTimers("timerName").Start
Wait 2
Msgbox "Time is ticking..."
MercuryTimers("timerName").Stop
Msgbox "Elapsed time is: " & MercuryTimers("timerName").Elapsedtime & " milliseconds"

/ QTP

Services.StartTransaction "transactionName"
Wait 2
Msgbox "Time is ticking..."
Services.EndTransaction "transactionName"
+1

All Articles