Spaces:
Sleeping
Sleeping
Download venv/lib/python3.14/site-packages/rich/_timer.py from HSR-DeepThink/Perhance: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/HSR-DeepThink/Perhance/resolve/main/venv/lib/python3.14/site-packages/rich/_timer.py
- Command line
-
hf download hf://spaces/HSR-DeepThink/Perhance/venv/lib/python3.14/site-packages/rich/_timer.py
-
curl -L -o _timer.py https://huggingface.co/spaces/HSR-DeepThink/Perhance/resolve/main/venv/lib/python3.14/site-packages/rich/_timer.py
417 Bytes
| """ | |
| Timer context manager, only used in debug. | |
| """ | |
| from time import time | |
| import contextlib | |
| from typing import Generator | |
| def timer(subject: str = "time") -> Generator[None, None, None]: | |
| """print the elapsed time. (only used in debugging)""" | |
| start = time() | |
| yield | |
| elapsed = time() - start | |
| elapsed_ms = elapsed * 1000 | |
| print(f"{subject} elapsed {elapsed_ms:.1f}ms") | |