Calculating SQL query processing
Yes, microtime is designed to be used for this. The PHP documentation mentions this use case for microtime().
Consider putting this into a loop and print out the average result: if the measured time is too small, you can't provide a reliable estimation.
Concerning the MySQL request: you should switch to mysqli or PDO.