Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个使用Haystack的 Django 应用程序。搜索后是否可以在搜索结果页面中显示搜索花费了多少时间?
您可以使用timepython 中的模块来实现:
time
import time start = time.time() # code which performs search end = time.time() time_taken = end - start
推time_taken送到您的模板。
time_taken