From ff1186f77cf8f3ab34846ebd901fb7feb2516b2a Mon Sep 17 00:00:00 2001 From: Parthe Pandit Date: Tue, 6 Dec 2022 11:34:08 -0800 Subject: [PATCH] Create an object automatically This saves a line in every main file, and usage becomes ```python from pytictoc import timer # main code ``` instead of ```python from pytictoc import TicToc timer=TicToc() # main code ```` --- pytictoc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytictoc.py b/pytictoc.py index 031ed8d..4b23162 100644 --- a/pytictoc.py +++ b/pytictoc.py @@ -75,3 +75,5 @@ def __exit__(self, *args): self.end = default_timer() self.elapsed = self.end - self.start print('Elapsed time is %f seconds.' % self.elapsed) + +timer = TicToc()