Spaces:
Build error
Build error
Download util/timer.py from JR818/JarvisSearchV2: direct link, hf CLI and curl.
- Browser
- Download file 314 Bytes
-
https://huggingface.co/spaces/JR818/JarvisSearchV2/resolve/main/util/timer.py
- Command line
-
hf download hf://spaces/JR818/JarvisSearchV2/util/timer.py
-
curl -L -o timer.py https://huggingface.co/spaces/JR818/JarvisSearchV2/resolve/main/util/timer.py
314 Bytes
| import time | |
| from datetime import datetime | |
| def timing(f): | |
| def wrap(*args, **kwargs): | |
| time1 = time.time() | |
| ret = f(*args, **kwargs) | |
| diff = int((time.time()-time1)*1000.0) | |
| print(f"[{datetime.now()}][{f.__name__}]] took {diff} ms inputs:{args}" ) | |
| return ret | |
| return wrap |