From fdd8ef1fc3741ac9472b3f9f6e46cf65827566aa Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Fri, 6 Oct 2023 19:51:36 +0100 Subject: ~ | new folder inluding `./tool`and `./testing` --- testing/log_time.py | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 testing/log_time.py (limited to 'testing/log_time.py') diff --git a/testing/log_time.py b/testing/log_time.py deleted file mode 100644 index 376ab86d..00000000 --- a/testing/log_time.py +++ /dev/null @@ -1,25 +0,0 @@ -from time import time - - -async def log_time_async(method: callable, **kwargs): - start = time() - result = await method(**kwargs) - secs = f"{round(time() - start, 2)} secs" - if result: - return " ".join([result, secs]) - return secs - - -def log_time_yield(method: callable, **kwargs): - start = time() - result = yield from method(**kwargs) - yield f" {round(time() - start, 2)} secs" - - -def log_time(method: callable, **kwargs): - start = time() - result = method(**kwargs) - secs = f"{round(time() - start, 2)} secs" - if result: - return " ".join([result, secs]) - return secs \ No newline at end of file -- cgit v1.2.3