Code to find execution of any PYTHON Program

import time
t0 = time.time()

def findExecution():
    """ This function will give execution time for a program"""
    print(f"THIS PROGRAM TAKES {time.time() - t0} EXECUTION TIME")
    
# for ex :
def fact(n):
    if(n == 1 or n==0):
        return 1
    else:
        return n * fact(n-1)
    
= int(input("Enter number = "))
print(f"{x}! = {fact(x)}")
findExecution()

print(findExecution.__doc__)
    


Comments

Popular Posts