Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
349 B
2
Indexable
Never
import time

def timing_decorator(func):
    def wrapper(*args, **kwargs):
        start_time = time.time()
        result = func(*args, **kwargs)
        end_time = time.time()
        elapsed_time = end_time - start_time
        print(f"'{func.__name__}' function took {elapsed_time:.5f} seconds to run.")
        return result
    return wrapper