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

$start1 = microtime(TRUE);
for($i=0;$i<count($array);$i++)
 {
    //do something
 }
$time1 = microtime(TRUE) - $start1;
有帮助吗?

解决方案

如果您在安装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的教程。

其他提示

如果不使用外部工具,我会说你已经做到了最好。

如果您想使用为此目的而构建的工具,其他答案都是无效的。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top