From 7629ad70fa83159af720a1fa84a7a939f40f4edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9Fan=20Atan?= <46249941+Starosti@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:21:07 +0300 Subject: [PATCH 1/2] Create timer_cagan_atan.py --- Week06/timer_cagan_atan.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Week06/timer_cagan_atan.py diff --git a/Week06/timer_cagan_atan.py b/Week06/timer_cagan_atan.py new file mode 100644 index 00000000..3d79faa4 --- /dev/null +++ b/Week06/timer_cagan_atan.py @@ -0,0 +1,15 @@ +import time + + +class Timer: + def __init__(self): + self.start_time = None + self.end_time = None + + def __enter__(self): + self.start_time = time.time() + return self + + def __exit__(self, exc_type, exc_value, exc_traceback): + self.end_time = time.time() + return False From 4eca61aa30984dff07ebefb7a88055a29cb7c6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9Fan=20Atan?= <46249941+Starosti@users.noreply.github.com> Date: Tue, 5 Nov 2024 12:46:21 +0300 Subject: [PATCH 2/2] Update timer_cagan_atan.py --- Week06/timer_cagan_atan.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Week06/timer_cagan_atan.py b/Week06/timer_cagan_atan.py index 3d79faa4..c57d1c93 100644 --- a/Week06/timer_cagan_atan.py +++ b/Week06/timer_cagan_atan.py @@ -12,4 +12,3 @@ def __enter__(self): def __exit__(self, exc_type, exc_value, exc_traceback): self.end_time = time.time() - return False