mirror of https://github.com/Textualize/rich.git
update timer to generator
This commit is contained in:
parent
fb4217acb1
commit
05843f6f69
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue