Skip to content

Conversation

@dbrgn
Copy link
Contributor

@dbrgn dbrgn commented May 19, 2011

I found the debugsqlshell really useful to compare different queries, but I also wanted to be able to time them, in order to tell which one will execute faster.

So I added a simple timing mechanism that uses a timedelta. I don't know whether there is a cleaner way, e.g. by retrieving the execution time directly from the query/database, but it seems to work pretty well this way.

@robhudson
Copy link
Contributor

Could you use datetime.now() instead of datetime.today(), in case the extra precision now provides makes an impact?

@dbrgn
Copy link
Contributor Author

dbrgn commented Sep 25, 2011

Yes, of course :) Changed.

robhudson added a commit that referenced this pull request Sep 27, 2011
Display execution time with query in debugsqlshell. Thanks gwrtheyrn.
@robhudson robhudson merged commit 05088bc into django-commons:master Sep 27, 2011
ryneeverett pushed a commit to ryneeverett/django-debug-toolbar that referenced this pull request Oct 2, 2016
Display execution time with query in debugsqlshell. Thanks gwrtheyrn.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants