import time start = time.time() # the code you want to check here end = time.time() print("the code took",end-start,"seconds")