From 18ff58072c17405b789c61d15be9afe82377ac89 Mon Sep 17 00:00:00 2001 From: Christian Haack <43646111+chrhck@users.noreply.github.com> Date: Wed, 28 Oct 2020 23:00:19 +0100 Subject: [PATCH] Update time_boss.py start timing after appending the current instance to the global stack --- time_boss/time_boss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time_boss/time_boss.py b/time_boss/time_boss.py index 680b416..5a9896b 100644 --- a/time_boss/time_boss.py +++ b/time_boss/time_boss.py @@ -57,8 +57,8 @@ def __init__(self, name: str): TimeBoss.all_timers[name] = self def __enter__(self): - self._start = perf_counter() TimeBoss.timer_stack.append(self) + self._start = perf_counter() def __exit__(self, type, value, traceback): dt = perf_counter() - self._start