mirror of
https://github.com/lucidrains/DALLE2-pytorch.git
synced 2025-12-19 17:54:20 +01:00
12 lines
198 B
Python
12 lines
198 B
Python
import time
|
|
|
|
class Timer:
|
|
def __init__(self):
|
|
self.reset()
|
|
|
|
def reset(self):
|
|
self.last_time = time.time()
|
|
|
|
def elapsed(self):
|
|
return time.time() - self.last_time
|