I use the microtime() function to get an estimate of how long it takes.
$start_time = microtime();
Do MySQL query
$end_time = microtime();
Then I have a little procedure that prints
the time-difference between $start_time and $end_time.
Ofcourse, this is extra work, so it will take extra CPU time.