Well it is working just fine, but it is outputting the result twice. It out puts it at the end of the page and when I call it. Problem is I only want it to output when I call it.
ob_start(END_TIMER);
ob_end_flush(END_TIMER);
function END_TIMER(){
global $start_time;
$end_time = microtime();
$end_time_array = explode(" ", $end_time);
$end_time = $end_time_array['0'] + $end_time_array['1'];
$start_time_array = explode(" ", $start_time);
$start_time = $start_time_array['0'] + $start_time_array['1'];
$execution_time = $end_time - $start_time;
$execution_time = number_format($execution_time, 5);
return $execution_time;
}