Skip to content

Commit

Permalink
add time logger
Browse files Browse the repository at this point in the history
  • Loading branch information
you-n-g committed Nov 13, 2021
1 parent a166b64 commit 8e2c34f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def wait(self, pid=None, message=None, idle=False, patience=20, sleep=3):
process_info = self._get_process_info(pid)

logger.info(f'Process[{pid}{process_info}] selected')
start_time = time.time()

cp = 0
while True:
Expand Down Expand Up @@ -141,7 +142,7 @@ def wait(self, pid=None, message=None, idle=False, patience=20, sleep=3):
time.sleep(sleep)
if message is None:
message = f'The Process[{pid}{process_info}] has stopped or become idle now.'
self.ntf(message)
self.ntf(f"[{time.time() - start_time:.1f}s] {message}")

def cmd(self, *cmd):
"""
Expand Down

0 comments on commit 8e2c34f

Please sign in to comment.