For a very simple profiling I use microtime()
like this:
$now = microtime();
for (...) {
// do something
echo microtime() - $now;
$now = microtime();
}
Now, the output of the echo
line seems completely random, that is, I expected fluctuations, but I didn't expect negative numbers showing up.
However, a typical result contains ~ 1/3 negative numbers. I confirmed this on Solaris (PHP 5.0.x) and WinVista (PHP 5.2.3).
What the heck is going on here? Have I invented accidently a time machine?
question from:
https://stackoverflow.com/questions/2607150/php-profiling-with-microtime-negative-time 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…