Created
July 1, 2010 11:11
-
-
Save kylef/459836 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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