Mercurial > piecrust2
comparison piecrust/serving.py @ 279:980bbbd0705e
serve: Correctly show timing info even when not in debug mode.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 01 Mar 2015 21:38:24 -0800 |
parents | 7ec06ec14247 |
children | 8c0c53a315ae |
comparison
equal
deleted
inserted
replaced
278:34194ca0ab85 | 279:980bbbd0705e |
---|---|
298 entry = ServeRecordPageEntry(req_path, page_num) | 298 entry = ServeRecordPageEntry(req_path, page_num) |
299 self._page_record.addEntry(entry) | 299 self._page_record.addEntry(entry) |
300 entry.used_source_names = set(render_ctx.used_source_names) | 300 entry.used_source_names = set(render_ctx.used_source_names) |
301 | 301 |
302 # Profiling. | 302 # Profiling. |
303 if app.debug: | 303 if app.config.get('site/show_debug_info'): |
304 now_time = time.clock() | 304 now_time = time.clock() |
305 timing_info = ('%8.1f ms' % | 305 timing_info = ('%8.1f ms' % |
306 ((now_time - app.env.start_time) * 1000.0)) | 306 ((now_time - app.env.start_time) * 1000.0)) |
307 rp_content = rp_content.replace('__PIECRUST_TIMING_INFORMATION__', | 307 rp_content = rp_content.replace('__PIECRUST_TIMING_INFORMATION__', |
308 timing_info) | 308 timing_info) |