summaryrefslogtreecommitdiffstats
path: root/testing/log_time.py
diff options
context:
space:
mode:
authorabc <98614666+xtekky@users.noreply.github.com>2023-10-06 20:51:36 +0200
committerabc <98614666+xtekky@users.noreply.github.com>2023-10-06 20:51:36 +0200
commitfdd8ef1fc3741ac9472b3f9f6e46cf65827566aa (patch)
treeff5efeecf9dd91e1b74b98ca21671e315cf61979 /testing/log_time.py
parent~ | Merge pull request #997 from hlohaus/all (diff)
downloadgpt4free-fdd8ef1fc3741ac9472b3f9f6e46cf65827566aa.tar
gpt4free-fdd8ef1fc3741ac9472b3f9f6e46cf65827566aa.tar.gz
gpt4free-fdd8ef1fc3741ac9472b3f9f6e46cf65827566aa.tar.bz2
gpt4free-fdd8ef1fc3741ac9472b3f9f6e46cf65827566aa.tar.lz
gpt4free-fdd8ef1fc3741ac9472b3f9f6e46cf65827566aa.tar.xz
gpt4free-fdd8ef1fc3741ac9472b3f9f6e46cf65827566aa.tar.zst
gpt4free-fdd8ef1fc3741ac9472b3f9f6e46cf65827566aa.zip
Diffstat (limited to 'testing/log_time.py')
-rw-r--r--testing/log_time.py25
1 files changed, 0 insertions, 25 deletions
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