<p>Is there a better way to profile code then:</p>

<pre><code>$start1 = microtime(TRUE);
for($i=0;$i&lt;count($array);$i++)
 {
    //do something
 }
$time1 = microtime(TRUE) - $start1;
</code></pre>

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.