Search Efforts

How do search Engines like Google or others calculate time required to search?

What is the code for calculating time required to get some page in html or asp or jsp (or any other supported in browsing)? This similar thing is used by search engines to find the time required to search the pages accordingly. I need the time in smallest unit. (like 0.0XX seconds)

Public Comments

  1. My best guess would be a start timestamp on the press of the search button and an end timestamp when the query is finished.
  2. In PHP you can use the function microtime, which return the timestamp very precisely. Store the time in a variable before the code execution, and then do the same in an another variable after the code execution and the make a difference.
  3. Any programming language will allow precision down to the millisecond. This is typically done one of two ways. Using server-side code (php, vb, etc) you grab the server's time before and after the search code is executed. Using client-side code (JavaScript), you basically do the same thing- subtracting the current time before and after you execute the code. Client-side grabs the time from the user's computer and the serv-side grabs the server's time. This should matter though, as long as your before and after times are from the same place.
Powered by Yahoo! Answers