Do you have a question? Post it now! No Registration Necessary. Now with pictures!
March 19, 2005, 6:29 am
rate this thread
Re: query time?
OK, so you can run microtime() before executing the query,
then again after executing the query, compute the difference,
and output the result.
The following example is based on code snippet given at
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
$time_start = microtime_float();
$result = mysql_query('Your query here');
$time_end = microtime_float();
$time = $time_end - $time_start;
echo "The query took $time seconds";