Related example macro: Demo-Stopwatch
Related example script: get-response-times.vbs
The STOPWATCH command in iMacros allows you to measure the time that elapses between the first occurrence of the command in a macro ( = stopwatch on) and the second occurrence ( = stopwatch off). By using different identifiers in the STOPWATCH command you can create up to a 100 independent measurement points in your macro.
In order to do web site response measuremnts, you need to insert the STOPWATCH statements manually after you recorded your macro. For accurate measurements it is important to set the browsers replay speed to FAST so no artificial delays are added.
iMacros response time measurements always reflects the true user experience as they are measured using a real browser. Therefore response times measured by iMacrso inlcude loading times for browser plug-ins such as the Macromedia Flash Player or the Java runtime.
By default, the measured times are saved to the Downloads\ directory of your iMacros installation (e.g. C:\Program Files\iMacros\Downloads\). The default file name is macroName_stopwatch.csv. You can instruct iMacro to save the data to a custom file name by setting the built-in variable !FILESTOPWATCH.
The values are comma separated (CSV format) so they can be viewed with any text editor, imported directly in Microsoft Excel or viewed by any other software you use. Additional information about the date and time of the measurements and the calling macro will be added to the response times.
In this example we measure response times of different parts of the iOpus homepage:
VERSION BUILD=4230323
SET !FILESTOPWATCH mydata.csv STOPWATCH ID=total
URL GOTO=http://www.iopus.com/imacros/
STOPWATCH ID=1
TAG POS=1 TYPE=A ATTR=HREF:http://www.iopus.com/imacros/compare
STOPWATCH ID=1 STOPWATCH ID=store
TAG POS=1 TYPE=A ATTR=TXT:US$<SP>149
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:order ATTR=NAME:ORDER_PRODUCT_NOW&&VALUE:Order<SP>Now
TAG POS=1 TYPE=A ATTR=HREF:http://www.iopus.com/store
STOPWATCH ID=store STOPWATCH ID=total
This macro will create the following data in the mydata.csv file - obviously the response times will be different when you replay this macro. The format of the file is:
YYYY/MM/DD, HH:MM:SS, Macro name, ID, time (s)