I’m sorry for misunderstanding.
If you just want to know which part cost the most time you could use time module to calculate them.
import time

start = time.time()
...(some cost time op)
print("This op cost {}".format(time.time()-start))