Is there a better way to profile code then:
$start1 = microtime(TRUE);
for($i=0;$i<count($array);$i++)
{
//do something
}
$time1 = microtime(TRUE) - $start1;
Is there a better way to profile code then:
$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.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.