If you want to calculate or record time taken by your steps in your programs, you can use the following code snippet
import time
start_time = time.time()
# Your program goes here
action()
time_taken = time.time() - start_time
print("Total time taken for the program execution", time_taken) # seconds
Total time taken for the program execution 10.005947589874268
Comment here