d52019163d08a5965fb8fe7596db003ff8614a4b
[wolnelektury.git] / apps / debug_toolbar / panels / timer.py
1 import time
2 from debug_toolbar.panels import DebugPanel
3
4 class TimerDebugPanel(DebugPanel):
5     """
6     Panel that displays the time a response took.
7     """
8     name = 'Timer'
9
10     def __init__(self, request):
11         super(TimerDebugPanel, self).__init__(request)
12         self._start_time = time.time()
13
14     def title(self):
15         return 'Time: %0.2fms' % ((time.time() - self._start_time) * 1000)
16
17     def url(self):
18         return ''
19
20     def content(self):
21         return ''