Hello. How can I get the k-millisecond for the request? I read that there is a function Explain, but it does not display the time of the request.
So will it be ok?
$startTime = microtime(); ЗАПРОС $endTime = microtime();
MySQL> 5.0.37 has a built-in profiler. It can be included like this:
set profiling=1; select count(*) from comment; select count(*) from message; show profiles;
As a result, we get:
+----------+------------+------------------------------+ | Query_ID | Duration | Query | +----------+------------+------------------------------+ | 1 | 0.00012700 | select count(*) from comment | | 2 | 0.00014200 | select count(*) from message | +----------+------------+------------------------------+ 2 rows in set (0.00 sec)
So you can track the "honest" query execution time, bypassing the time to connect with MySQL :)
That's actually a subject
Source: https://ru.stackoverflow.com/questions/199490/
All Articles