how to get time cost for MySQL query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/11/05, x <shamubro@xxxxxxxxx> wrote:
> Since we can see the time cost each time we query MySQL through MySQL
> console (such as 75 rows in set (0.01 sec)), so I am wondering there is
> already an existing function which will return the value...

I think you are confusing two things: mysql server and mysql
command-line client.
The time cost is calculated at the client side in mysql command-line
client. It's not retrieved from the server but rather calculated with
the help of three functions defined in mysql.cc: start_timer,
end_timer, mysql_end_time (all are internal functions that don't have
anything to do with the server). It's done more or less the way you
would normally do it in php: (1) take down current time (2) do the
query (3) take down time again and calculate the difference.

-ahmed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux