Question

I have a Django app that uses Haystack. Is it possible to show after a search, in the search result page, how much time the search took ?

Was it helpful?

Solution

You can use the time module from python to achieve that:

import time

start = time.time()
# code which performs search
end = time.time()
time_taken = end - start

Push time_taken to your template.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top