Files
typeshed/stdlib/timeit.pyi
2021-08-08 11:05:21 +02:00

32 lines
1.1 KiB
Python

from typing import IO, Any, Callable, Dict, List, Sequence, Tuple, Union
_Timer = Callable[[], float]
_Stmt = Union[str, Callable[[], Any]]
default_timer: _Timer
class Timer:
def __init__(
self, stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., globals: Dict[str, Any] | None = ...
) -> None: ...
def print_exc(self, file: IO[str] | None = ...) -> None: ...
def timeit(self, number: int = ...) -> float: ...
def repeat(self, repeat: int = ..., number: int = ...) -> List[float]: ...
def autorange(self, callback: Callable[[int, float], Any] | None = ...) -> Tuple[int, float]: ...
def timeit(
stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., number: int = ..., globals: Dict[str, Any] | None = ...
) -> float: ...
def repeat(
stmt: _Stmt = ...,
setup: _Stmt = ...,
timer: _Timer = ...,
repeat: int = ...,
number: int = ...,
globals: Dict[str, Any] | None = ...,
) -> List[float]: ...
_timerFunc = Callable[[], float]
def main(args: Sequence[str] | None = ..., *, _wrap_timer: Callable[[_timerFunc], _timerFunc] | None = ...) -> None: ...