monitor: properly initialize timer_start
It is set in `module()` which must be called before `result` so the actual usage was fine, but it was not initialized in `__init__`.
This commit is contained in:
parent
d04ce2e1ef
commit
1bcbf3a2d2
1 changed files with 5 additions and 0 deletions
|
|
@ -91,6 +91,11 @@ class LogMonitor(BaseMonitor):
|
|||
the log will get written to. If `fd` is a `TTY`, escape
|
||||
sequences will be used to highlight sections of the log.
|
||||
"""
|
||||
|
||||
def __init__(self, fd: int):
|
||||
super().__init__(fd)
|
||||
self.timer_start = 0
|
||||
|
||||
def result(self, result):
|
||||
duration = int(time.time() - self.timer_start)
|
||||
self.out.write(f"\n⏱ Duration: {duration}s\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue