From 7e726a9979b750afcb586b84f23568cd766db3af Mon Sep 17 00:00:00 2001 From: Natalie Fearnley Date: Mon, 20 May 2024 21:18:06 -0400 Subject: [PATCH] removed timing.py --- sizebot/lib/timing.py | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 sizebot/lib/timing.py diff --git a/sizebot/lib/timing.py b/sizebot/lib/timing.py deleted file mode 100644 index 210eb340..00000000 --- a/sizebot/lib/timing.py +++ /dev/null @@ -1,28 +0,0 @@ -from typing import Any -from collections.abc import Callable - -import functools - -import arrow - - -timedfuncs: list[Callable] = [] - - -def timethis(name: str) -> Callable: - def wrapper(fn: Callable) -> Callable: - fn.name = name - - @functools.wraps - def wrapped(*args, **kwargs) -> Any: - fn.start = arrow.now() - res = fn(args, **kwargs) - fn.end = arrow.now() - return res - timedfuncs.append(wrapped) - return wrapped - return wrapper - - -for fn in timedfuncs: - print(fn.name, fn.end - fn.start)