<?php
class Script_Timer
{
   function Script_Timer ()
   {
       return true;
   }
   
   function Start_Timer ()
   {
       define ("TIMER_START_TIME", microtime());
       
       return true;
	}
	function Get_Time ($decimals=2)
   {
       // $decimals will set the number of decimals you want for your milliseconds.

       // format start time
       $start_time = explode (" ", TIMER_START_TIME);
       $start_time = $start_time[1] + $start_time[0];
       // get and format end time
       $end_time = explode (" ", microtime());
       $end_time = $end_time[1] + $end_time[0];
       
       return number_format ($end_time - $start_time, $decimals);
   }
}
/* example usage
	Script_Timer::Start_Timer();

	$mt = explode(' ', microtime()); 
	$script_start_time = $mt[0] + $mt[1];


	$mt = explode(' ', microtime()); 
	$script_end_time = $mt[0] + $mt[1];
	$total_time = Script_Timer::Get_Time();
*/	


?>