comparison piecrust/serving/server.py @ 554:155c7e20414f

serve: Fix timing information in the debug window.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 08 Aug 2015 22:22:22 -0700
parents cc6f3dbe3048
children daf8df5ade7d
comparison
equal deleted inserted replaced
553:cc6f3dbe3048 554:155c7e20414f
200 page = rendered_page.page 200 page = rendered_page.page
201 rp_content = rendered_page.content 201 rp_content = rendered_page.content
202 202
203 # Profiling. 203 # Profiling.
204 if app.config.get('site/show_debug_info'): 204 if app.config.get('site/show_debug_info'):
205 now_time = time.clock() 205 now_time = time.perf_counter()
206 timing_info = ( 206 timing_info = (
207 '%8.1f ms' % 207 '%8.1f ms' %
208 ((now_time - app.env.start_time) * 1000.0)) 208 ((now_time - app.env.start_time) * 1000.0))
209 rp_content = rp_content.replace( 209 rp_content = rp_content.replace(
210 '__PIECRUST_TIMING_INFORMATION__', timing_info) 210 '__PIECRUST_TIMING_INFORMATION__', timing_info)