IRRA / lib /utils /timer.py
grostaco's picture
feat: add timer
9ebc77b
raw
history blame contribute delete
165 Bytes
from time import perf_counter
from contextlib import contextmanager
@contextmanager
def timer():
start = perf_counter()
yield lambda: perf_counter() - start