Time it took for query (MySQL & PHP)

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mikebr
Forum Contributor
Posts: 243
Joined: Sat Sep 28, 2002 7:05 am

Time it took for query (MySQL & PHP)

Post by mikebr »

I want to show the user the length of time it took to get the results from a mysql query, is there a fuction that eludes me or do I need to get the time before the query is run then again after it has run and subtract them? anyone know what is the best way to do this?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

I'd probably do this the way you have suggested: there's a getmicrotime script somewhere in the php manual which you could use.
mikebr
Forum Contributor
Posts: 243
Joined: Sat Sep 28, 2002 7:05 am

Post by mikebr »

Great, got one, thanks for the pointer.
Post Reply