문제

코드를 프로필하는 더 좋은 방법이 있습니까?

$start1 = microtime(TRUE);
for($i=0;$i<count($array);$i++)
 {
    //do something
 }
$time1 = microtime(TRUE) - $start1;
도움이 되었습니까?

해결책

Xdebug or Zend Debugger if you have some difficulty to install Xdebug.

Their profiler will time everything for you without any modification of your code.

http://www.xdebug.org/

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

http://devzone.zend.com/article/2899-Profiling-PHP-Applications-With-xdebug - a serie of tutorials about xdebug.

다른 팁

Without using an external tool, I would say you've done the best you can.

If you want to use a tool built for the purpose, the other answers are dead-on.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top