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?
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...