Download src/utils.py from servisgas/pricing: direct link, hf CLI and curl.
- Browser
- Download file 333 Bytes
-
https://huggingface.co/spaces/servisgas/pricing/resolve/main/src/utils.py
- Command line
-
hf download hf://spaces/servisgas/pricing/src/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/servisgas/pricing/resolve/main/src/utils.py
333 Bytes
| from time import perf_counter | |
| class Timer: | |
| def __init__(self, label: str): | |
| self.label = label | |
| def __enter__(self): | |
| self.start = perf_counter() | |
| return self | |
| def __exit__(self, exc_type, exc, tb): | |
| elapsed = perf_counter() - self.start | |
| print(f"⏱ {self.label} took {elapsed:.2f}s") |