From e0e717f0fceb0ae002097353a25f5a4590757602 Mon Sep 17 00:00:00 2001 From: timothyas Date: Mon, 3 Jun 2024 11:14:57 -0600 Subject: [PATCH] add timer.now method --- ufs2arco/timer.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ufs2arco/timer.py b/ufs2arco/timer.py index 38760ac..37028de 100644 --- a/ufs2arco/timer.py +++ b/ufs2arco/timer.py @@ -54,6 +54,14 @@ def stop(self, mytitle="Elapsed time"): self._print(f"{mytitle}: {elapsed_time:.4f} seconds\n") return float(elapsed_time) + def now(self): + """Return the time elapsed since timer was started, without stopping the timer + + Returns: + (float): elapsed time in seconds + """ + return float(self.get_elapsed()) + def _print(self, *args, **kwargs): """Print the timing to :attr:`filename` if specified, or to screen.