I have used microtime() to check code execution time. But it seems very strange like time tracked is not correct.
So in my test.php, I have code like following:
$debug = true;
$start = microtime(true);
$newline = "<br/>";
...
if ($debug) {
$time_elapsed_secs = microtime(true) - $start;
$start = microtime(true);
echo 'Step 1 Done: ' . $time_elapsed_secs . $newline; }
...
if ($debug) {
$time_elapsed_secs = microtime(true) - $start;
$start = microtime(true);
echo 'Step 2 Done: ' . $time_elapsed_secs . $newline; }
Then when I open the URL on browser, it response in less then 1 sec, but it shows something strange value like Step 1 Done: 0.0026565 Step 2 Done: 9.8646454
How come this would happen? Do I do something in wrong way?