We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b3c87e commit d0cdeb4Copy full SHA for d0cdeb4
bpython/repl.py
@@ -65,18 +65,17 @@ class RuntimeTimer:
65
66
def __init__(self) -> None:
67
self.reset_timer()
68
- self.time = time.monotonic if hasattr(time, "monotonic") else time.time
69
70
def __enter__(self) -> None:
71
- self.start = self.time()
+ self.start = time.monotonic()
72
73
def __exit__(
74
self,
75
exc_type: Optional[Type[BaseException]],
76
exc_val: Optional[BaseException],
77
exc_tb: Optional[TracebackType],
78
) -> Literal[False]:
79
- self.last_command = self.time() - self.start
+ self.last_command = time.monotonic() - self.start
80
self.running_time += self.last_command
81
return False
82
0 commit comments