$ kernprof -l -v example.py Wrote profile results to example.py.lprof Timer unit: 1e-06 s Total time: 1.00117 s File: example.py Function: index at line 13 Line # Hits Time Per Hit % Time Line Contents ============================================================== 13 @app.route('/') 14 @profile 15 def index(): 16 1 1001072 1001072.0 100.0 time.sleep(1) 17 1 97 97.0 0.0 fn = request.environ.get('werkzeug.server.shutdown') 18 1 3 3.0 0.0 if fn: 19 fn() 20 1 2 2.0 0.0 return 'ok'