PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > MySQL
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools
Old 8-22-02, 10:55 PM   #1
ffejy
Endangered Species
 
ffejy's Avatar
 
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"?
ffejy is offline  
Old 8-22-02, 11:54 PM   #2
HalfaBee
 
HalfaBee's Avatar
 
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
HalfaBee is offline  
Old 8-23-02, 01:25 PM   #3
ffejy
Endangered Species
 
ffejy's Avatar
 
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"?
ffejy is offline  
Old 8-24-02, 12:11 AM   #4
HalfaBee
 
HalfaBee's Avatar
 
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
HalfaBee is offline  
Old 8-24-02, 12:18 AM   #5
ffejy
Endangered Species
 
ffejy's Avatar
 
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"?
ffejy is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:10 PM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.