Return to Snippet

Revision: 15390
at July 3, 2009 07:17 by 1man

Initial Code
$(function(){"Start Test");
	var d = new Date();//Get our start time + " " + d.getMilliseconds());
	//Run our test
	var testBody = "";
	for (var i=0; i<1000; i++){
		testBody += "<div class='testable"+i+"'>";
	for (var j=0; j<1000; j++){
	var d = new Date();//Get our end time + " " + d.getMilliseconds());"End Test");
	 * Console will now log 2 times, the difference between 
	 * them is how long the test took to run

Initial URL

Initial Description
A way to time how long it takes to get through a certain block of code. Good way to measure performance on the page.

You could also use the built in logging functions in firebug. Not sure how they would tally up in a test.

Initial Title
Function Timing Example (includes jQuery)

Initial Tags

Initial Language