diff --git a/challenge.py b/challenge.py index c69287d..799928f 100644 --- a/challenge.py +++ b/challenge.py @@ -1,8 +1,19 @@ import time -def finish_date(): +def finish_date(func): # You have to code here!! + def wrapper(*args, **kwargs): + + initial_time = time.time() + func(*args, **kwargs) + final_time = time.time() + duration = final_time - initial_time + local_time = time.localtime() + finalization_time = time.strftime("%d/%m/%Y - %H:%M:%S", local_time) + print('Function {} ended its execution at: {} . And it took {} seconds to be executed'.format(func.__name__, finalization_time, round(duration, 6))) + + return wrapper @finish_date