|
| Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Endangered Species
Join Date: Apr 2002
Location: Massachusetts
Posts: 452
Reputation: 5
|
MySQL query time
I know when you run a mysql query from the command line, it returns the table, and it says how long it took to run the query. Is there a function to get this number in PHP?
__________________
Jeff Why doesn't DOS ever say "Good command or file name"? |
|
|
|
|
#2 |
|
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 7,266
Reputation: 340
|
I dont think there is you may have to do it manually.
function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } $time_start = getmicrotime(); mysql_query( "" ); $time_end = getmicrotime(); $time = $time_end - $time_start; echo "Did nothing in $time seconds"; HalfaBee
__________________
I don't suffer from laziness, I enjoy every minute! Edit your php.ini here http://members.powweb.com/member/cgi...nt/PHPplus.bml |
|
|
|
|
#3 |
|
Endangered Species
Join Date: Apr 2002
Location: Massachusetts
Posts: 452
Reputation: 5
|
Thanks HalfaBee! I looked in the manual and didn't see any obvious functions like mysql_get_query_time()
Thanks for that snippet ![]()
__________________
Jeff Why doesn't DOS ever say "Good command or file name"? |
|
|
|
|
#4 |
|
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 7,266
Reputation: 340
|
Thats Ok its from the php manual.
![]() HalfaBee
__________________
I don't suffer from laziness, I enjoy every minute! Edit your php.ini here http://members.powweb.com/member/cgi...nt/PHPplus.bml |
|
|
|
|
#5 |
|
Endangered Species
Join Date: Apr 2002
Location: Massachusetts
Posts: 452
Reputation: 5
|
Well, you found it there... thanks
![]()
__________________
Jeff Why doesn't DOS ever say "Good command or file name"? |
|
|
![]() |
| Thread Tools | |
|
|