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):
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
Post a Comment