Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005
    Posts
    26

    Unanswered: 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.

  2. #2
    Join Date
    Apr 2006
    Location
    Denver, Co. USA
    Posts
    242
    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •