Forum Discussion

syafiq's avatar
7 years ago

Customizing search result to display time taken

Hi There,

 

Just wondering, is possible to customize the search result to display time taken to complete the request. like the one in the google result eg . About 1,050,000,000 results (0.93 seconds)

 

 

      • syafiq - I don't think there is any clean way to achieve this.  However, you can use JS hack. 

         

        By clicking on search button.

         

        1. Get the current timestamp (TimeStamp A)

        2. Get the timestamp (TimeStamp B) once the result div is being updated. 

        3. Subtract the times TimeStamp A from TimeStamp B. 

         

        This will give you the time taken by a query. This won't be fully accurate, but you only can go that much closer using JS.