function RunExpensiveFactorial() {
	var startTime = new Date();
	var nFactorial = 1;
	var nExponent = 1;
	var iterations = 0;
	
	var now = new Date();
	while (now.getTime()-startTime.getTime()<LengthPerTest) {
		
		//Browsers start to get funny if you go too much higher than 1x10^306
		//	If this happens, we'll start our loop back at 1
		if ( factorial(nFactorial) >= 1e+306) { nFactorial = 1; }	//Expensive, recursive factorial problem
		if ( Math.pow(2,nExponent) >= 1e+306) { nExponent = 1; }	//Expensive exponent problem
		
		nFactorial += 1;
		nExponent += 1;
		
		iterations += 1;
		now = new Date();
	}
	
	var adjustedLength;
	adjustedLength = iterations/(now.getTime()-startTime.getTime());
	return adjustedLength;
}

function factorial(n) {
	//Recursive function that returns the factorial of a number
	if (n==0) { return 1; } //http://mathforum.org/dr.math/faq/faq.0factorial.html
	else if (n==1) { return 1; } //end recursion
	else {
		var value = (n * factorial(n-1));
		return value;
    }
}