var output = document.getElementById("output"),
	tests  = document.getElementById("tests");

function addTest(name, func, details) {
	var li = document.createElement('li'),
		a = document.createElement('a');
	
	li.appendChild(a);
	if (details) {
		li.appendChild( document.createTextNode(' - ' + details) );
	}
	
	a.appendChild( document.createTextNode(name) );
	a.href = '#';
	a.onclick = makeTest(func, name);
	
	tests.appendChild(li);
}

function makeTest(func, name) {
	return function() {
		var i = loopCount,
			start = new Date();
		
		while (i--) {
			func();
		}
		
		log( (new Date() - start) + "ms - " + name );
		
		return false;
	}
}

function log(msg) {
	output.appendChild( document.createTextNode(msg) );
	output.appendChild( document.createElement('br') );
}