<?PHP
// mark the start time
$start_time = MICROTIME(TRUE);
// ...function or processing code...
// mark the stop time
$stop_time = MICROTIME(TRUE);
// get the difference in seconds
$time = $stop_time - $start_time;
PRINT "Elapsed time was $time seconds.";
?>