From 0f6e4ad131474e5690ffc2ae5f44a7007951d879 Mon Sep 17 00:00:00 2001 From: Jose Melendez Date: Sat, 25 Jul 2020 16:23:20 -0500 Subject: [PATCH] Decorator Function - Print execution date --- challenge.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/challenge.py b/challenge.py index c69287d..476780a 100644 --- a/challenge.py +++ b/challenge.py @@ -1,8 +1,15 @@ import time -def finish_date(): - # You have to code here!! +def finish_date(function): + def wrapper(*args, **kwargs): + import time + captured_time = time.gmtime() + print_time = time.strftime("Execution time: %d/%m/%Y - %H:%M:%S", captured_time) + function(*args, **kwargs) + print(print_time) + return function(*args, **kwargs) + return wrapper @finish_date