Skip to main content

Bug Tracker

Side navigation

Ticket #2550: test.js


File test.js, 0.4 KB (added by flesler, March 19, 2008 01:59PM UTC)

File to run the tests

$(schedule);

var attempt = 0, limit = 4;

function runTest(){
	
	var i = 500,
		$e = $('#target'),
		name = 'offset(500 times) - attempt '+attempt;
		
	if( attempt == 1 )
		console.profile();
		
	console.time(name);
	while( i-- )
		$e.offset();
	console.timeEnd(name);
	
	if( attempt != limit )
		schedule()
	else
		console.profileEnd();
};
function schedule(){
	attempt++;
	setTimeout(runTest, 1500 );
};

Download in other formats:

Original Format