froehoel
10/30/2014 - 3:39 AM

console log execution time

console log execution time

// basic execution time function
function getExecutionTime(){
	$mtime = microtime(); 
	$mtime = explode(" ",$mtime); 
	$mtime = $mtime[1] + $mtime[0]; 
	$starttime = $mtime; 
	
	$mtime = microtime(); 
	$mtime = explode(" ",$mtime); 
	$mtime = $mtime[1] + $mtime[0]; 
	$endtime = $mtime; 
	$totaltime = ($endtime - $starttime); 

	return '<script>console.log("Include db took ' . $totaltime . ' seconds")</script>'; 
}