PHP5: Quick on timing a script

Sometimes it is nice to know how long a scrip took to execute (or a part of a script).
This is a simple way to time a script in php.

$time_start = microtime(true);
 
usleep(500);
 
$time_end = microtime(true);
$time = $time_end - $time_start;
 
echo "run time was " . $time . " seconds";