0

那么有没有更好的方法来分析代码:

$start1 = microtime(TRUE);
for($i=0;$i<count($array);$i++)
 {
    //do something
 }
$time1 = microtime(TRUE) - $start1;
4

2 回答 2

2

如果您在安装 Xdebug 时遇到困难,请使用 Xdebug 或 Zend Debugger。

他们的分析器将为您计时,无需修改您的代码。

http://www.xdebug.org/

http://www.zend.com/en/community/pdt

http://devzone.zend.com/article/2899-Profiling-PHP-Applications-With-xdebug - 一系列关于 xdebug 的教程。

于 2008-10-09T09:56:48.057 回答
0

如果不使用外部工具,我会说你已经尽力了。

如果您想使用为此目的而构建的工具,那么其他答案都是固定的。

于 2008-10-09T11:43:59.713 回答