Page 1 of 1

how do we find query execution time???

Posted: Mon Sep 12, 2005 3:54 pm
by raghavan20
I am wondering how sites are displaying that it took n seconds to display the search result.
also, how do they display a graphical moving cursor which denotes that a search is going on???
any logic and suggestions are welcome.

Posted: Mon Sep 12, 2005 5:04 pm
by feyd
  1. you time the query operation.
  2. Using http://www.phpclasses.org/browse/package/1704.html

Posted: Mon Sep 12, 2005 5:45 pm
by raghavan20
you time the query operation
feyd, i dont really understand when you say timing the query.
i am not looking for code, but for logic or algorithm

Posted: Mon Sep 12, 2005 5:58 pm
by feyd
there's no real logic behind it.. you get a timestamp before, you get one after.. you find the difference between the two and you have the time taken to execute the query...

Posted: Tue Sep 13, 2005 5:39 am
by raghavan20
thats wot I also saw from another website.
Is it possible using SELECT statement to find the execution time???

Posted: Tue Sep 13, 2005 6:23 am
by shiznatix
i don't think you can use sql to get the execution time that i know of but what is wrong with using php?

[fake code]
$time = time_stamp_thing();
$do_query();
$time2 = time_stamp_thing();
$executed = $time2 - $time;
echo $executed;
[/fake code]