Spaces:
Runtime error
Runtime error
Download utils/time_watch.py from Preeeeet/3D-Room-Layout-Estimation_LGT-Net: direct link, hf CLI and curl.
- Browser
- Download file 502 Bytes
-
https://huggingface.co/spaces/Preeeeet/3D-Room-Layout-Estimation_LGT-Net/resolve/main/utils/time_watch.py
- Command line
-
hf download hf://spaces/Preeeeet/3D-Room-Layout-Estimation_LGT-Net/utils/time_watch.py
-
curl -L -o time_watch.py https://huggingface.co/spaces/Preeeeet/3D-Room-Layout-Estimation_LGT-Net/resolve/main/utils/time_watch.py
502 Bytes
| """ | |
| @Date: 2021/07/18 | |
| @description: | |
| """ | |
| import time | |
| class TimeWatch: | |
| def __init__(self, name="", logger=None): | |
| self.name = name | |
| self.start = time.time() | |
| self.logger = logger | |
| def __del__(self): | |
| end = time.time() | |
| output = f"{self.name} | time use {(end - self.start):.2f}s." | |
| if self.logger: | |
| self.logger.info(output) | |
| else: | |
| print(output) | |
| if __name__ == '__main__': | |
| w = TimeWatch("__main__") | |
| time.sleep(2) |