0

I've used the usefull hint described in https://stackoverflow.com/a/50384459/13535575 to get each Notebook cell elapsed time. But how can i get the total notebook elapsed time at the end of the "Run all"?

Tx in advance, Ghilder

1 Answers1

0
import time

def elapsed_time(start, end):
    hours, rem = divmod(end-start, 3600)
    minutes, seconds = divmod(rem, 60)
    print("Elapsed Time: {:0>2}:{:0>2}:{:05.2f}"
                .format(int(hours),int(minutes),seconds))

#Test

#First cell of your notebook 
start = time.time()
# Anothers cells ...

#Two last line of Notebook
end = time.time()
elapsed_time(start, end)
Wender
  • 991
  • 15
  • 24