Skip to content

Instantly share code, notes, and snippets.

@kylef
Created July 1, 2010 11:11
Show Gist options
  • Save kylef/459836 to your computer and use it in GitHub Desktop.
Save kylef/459836 to your computer and use it in GitHub Desktop.
import time
from request.plugins import plugins
from request.models import Request
def timer(callback, args=[], kwargs={}):
start = time.time()
callback(*args, **kwargs)
stop = time.time()
return stop - start
for plugin in plugins.plugins:
plugin.qs = Request.objects.all()
print "%s completed in %s" % (plugin.__class__.__name__, timer(plugin.render))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment