If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Output how long a search took

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-06, 08:47
db__novice db__novice is offline
Registered User
 
Join Date: Oct 2005
Posts: 26
Output how long a search took

I would like to output how long a search took, for example when you use Google it says at the top (0.03 seconds). I'm using MySQL version 4.0.13 but can't find any way to achieve this using SQL.

I've done something similar in Perl using Benchmark (Start & End, then working out the time difference between the two) but I don't think it's accurate enough. Basically, is there a SQL variable that I can pass to Perl which I can then output?

Any help would be very much appreciated.
Reply With Quote
  #2 (permalink)  
Old 10-03-06, 10:03
dbmab dbmab is offline
Registered User
 
Join Date: Apr 2006
Location: Denver, Co. USA
Posts: 240
Mysql has a MICROSECOND function but none of the functions that get the server time (NOW(), SYSDATE(), UNIX_TIMESTAMP()) contain a microsecond value, at least on my server (I test using SELECT MICROSECOND(various functions here...);.) So, I believe that mysql will not do this for you.

PHP has a microsecond() function that is typically used for this. I don't know if the perl functions you mention are the equivalent to this...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On