update timer to generator

This commit is contained in:
Nathan Page 2021-05-09 15:02:50 -07:00
parent fb4217acb1
commit 05843f6f69
1 changed files with 2 additions and 2 deletions

View File

@ -6,11 +6,11 @@ Timer context manager, only used in debug.
from time import time
import contextlib
from typing import Iterator
from typing import Generator
@contextlib.contextmanager
def timer(subject: str = "time") -> Iterator[None]:
def timer(subject: str = "time") -> Generator[None, None, None]:
"""print the elapsed time. (only used in debugging)"""
start = time()
yield