Spaces:
Running on Zero
Running on Zero
Download maploc/utils/tools.py from SammySnake/BEV: direct link, hf CLI and curl.
- Browser
- Download file 421 Bytes
-
https://huggingface.co/spaces/SammySnake/BEV/resolve/main/maploc/utils/tools.py
- Command line
-
hf download hf://spaces/SammySnake/BEV/maploc/utils/tools.py
-
curl -L -o tools.py https://huggingface.co/spaces/SammySnake/BEV/resolve/main/maploc/utils/tools.py
421 Bytes
| # Copyright (c) Meta Platforms, Inc. and affiliates. | |
| import time | |
| class Timer: | |
| def __init__(self, name=None): | |
| self.name = name | |
| def __enter__(self): | |
| self.tstart = time.time() | |
| return self | |
| def __exit__(self, type, value, traceback): | |
| self.duration = time.time() - self.tstart | |
| if self.name is not None: | |
| print("[%s] Elapsed: %s" % (self.name, self.duration)) | |