python - How do I time script execution time in PyCharm without adding code every time? -


currently add following lines around code:

import time start_time = time.time()  # code here  print "time elapsed: {:.2f}s".format(time.time() - start_time) 

is possible achieve same without adding code every script want time? either adding in run configuration or using plugin?

you can profile script hitting 'profile' button (it right of 'run', 'debug', , 'run coverage' buttons):

profile button

among output, find name of script itself, , time needed run it.

note: function available in pycharm professional 2017.1 linux platform; other installations might not provide profiler button.


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -