Spaces:
Sleeping
Sleeping
Download utils.py from shoyebb26/SuperMarioRL: direct link, hf CLI and curl.
- Browser
- Download file 536 Bytes
-
https://huggingface.co/spaces/shoyebb26/SuperMarioRL/resolve/main/utils.py
- Command line
-
hf download hf://spaces/shoyebb26/SuperMarioRL/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/shoyebb26/SuperMarioRL/resolve/main/utils.py
536 Bytes
| import time | |
| import datetime | |
| def get_current_date_time_string(): | |
| return datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S") | |
| class Timer(): | |
| def __init__(self): | |
| self.times = [] | |
| def start(self): | |
| self.t = time.time() | |
| def print(self, msg=''): | |
| print(f"Time taken: {msg}", time.time() - self.t) | |
| def get(self): | |
| return time.time() - self.t | |
| def store(self): | |
| self.times.append(time.time() - self.t) | |
| def average(self): | |
| return sum(self.times) / len(self.times) |