How to calculate total execution time of functions?

Podskajite how to get the total execution time of the functions (a and b) and how to move to timeit?
def a():
 start_time = time.time()
 print("--- %s sec ---" % (time.time() - start_time))

def b():
 start_time = time.time()
 print("--- %s sec ---" % (time.time() - start_time))

if __name__ == "__main__":
a()
 b()
March 12th 20 at 08:01
1 answer
March 12th 20 at 08:03
def a():
 # do something 1

def b():
 # do something 2

if __name__ == "__main__":
 start_time = time.time()
a()
b()
 print("--- %s sec ---" % (time.time() - start_time))

Find more questions by tags Python