是否有更好的方法来分析代码,然后:更好的配置文件的方式?
$start1 = microtime(TRUE);
for($i=0;$i<count($array);$i++)
{
//do something
}
$time1 = microtime(TRUE) - $start1;
是否有更好的方法来分析代码,然后:更好的配置文件的方式?
$start1 = microtime(TRUE);
for($i=0;$i<count($array);$i++)
{
//do something
}
$time1 = microtime(TRUE) - $start1;
的Xdebug或Zend的调试器,如果你有一定的难度安装Xdebug的。
他们的分析器会为你做所有事情,而不需要对代码进行任何修改。
http://www.zend.com/en/community/pdt
http://devzone.zend.com/article/2899-Profiling-PHP-Applications-With-xdebug - 关于XDebug的教程的系列。
没有使用外部工具,我会说你已经尽力而为。
如果您想使用为此目的而构建的工具,则其他答案是无效的。
如果你打算像这样的配置文件,然后移动你的计数超出时间间隔。 – gradbot 2008-10-09 15:58:51