import time
def func_A():
time.sleep(1)
def func_B():
time.sleep(10)
if __name__=='__mian__':
func_A()
func_B()
and you want to figure out which part takes the most time to finish. What you can do is:python -m cProfile simple.pyHowever, the output is kinda too complicated to understand.
A better way is to use 'cprofilev', which you can install from here.
python -m cProfilev simple.pyOutput would look like:
[cProfileV]: cProfile output available at http://127.0.0.1:4000Just go to http://127.0.0.1:4000 and all the information are right there waiting for you.
## https://github.com/ymichael/cprofilev