DonB
|
Posted: 05/25/2006, 12:19 PM |
|
I use the following modification to the query() method of db_mysql.php:
if ($this->Debug) $time_start = microtime();
$this->Query_ID = @mysql_query($Query_String,$this->Link_ID);
if ($this->Debug) printf("Debug: query = ' . (<b>%.4fs.</b>')
%s<br>\n", microtime() - $time_start, $Query_String);
This spits out the execution time for each query. I sometimes set the value
of $this-Debug() to 'true' by default, so an entire page can be evaluated at
once.
This just helped me find a query taking nearly a second to complete and once
I realized this, I was able to knock it down to 0.15. Otherwise, I probably
would never have discovered it.
--
DonB
http://www.gotodon.com/ccbth
|
|
|
|