1$start = microtime(true);
2while (...) {
3
4}
5$time_elapsed_secs = microtime(true) - $start;
1<?php
2//No need for microtime at the start of script.
3
4// Use this at the end of your script, or around in the
5// code where you need to take meassures.
6$time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
7
8echo "Did stuff in $time seconds\n";
9?>
10