How do I add a query execution time for my PHP / MySQL scripts?

Question by ViralRiver: How do I add a query execution time for my PHP / MySQL scripts?
So at the bottom of the page it will say:

Query Execution Time: xxxx ms.
anyone?

Best answer:

Answer by Trev
Guessing that you use PHP then look at microtime() function.
Just call the function at start of script , then again just before sending results to browser.
Subtract second call from first call and you will have the time taken to execute query.

It’s that simple!

Add your own answer in the comments!

Get the book now