Simple load test on a web page

From Chickenfoot Script Repository

/**************************************************************
* Set the url to hit, and the number of page loads to execute *
**************************************************************/
var url = "http://";
var numOfLoads = 10;


var timer = totalTime = errors = 0;

for (var i = 0; i < numOfLoads; i++) {
	timer = (new Date()).getTime();
	go(url, true);
	wait();
	timer = (new Date()).getTime() - timer;
	totalTime += timer;
	output((i+1) + ") loaded in " + timer + " milliseconds");

	/*********************************************************************
	* Uncomment below if you need to search the page for a certain value *
	*********************************************************************/
	/*
	if (find(/Search String Here/).hasMatch) {
		output("match found");
	} else {
		output("match not found");
		errors++;
	}
	*/
}

output("\n" + errors + " errors found");
output("Average load time: " + (totalTime/i) + " milliseconds");