class_docstr: Allows easy observation of a given PID for resource usage
class_docstr_tok: ["Allows","easy","observation","of","a","given","PID","for","resource","usage"]
docstr: Write statistics
docstr_tok: ["Write","statistics"]
code: def work(self):
      """Write statistics"""
      import psutil
  
      try:
          self._update_record()
      except psutil.NoSuchProcess:
          pass  # skip, process died in flight
      except AttributeError:
          pass
  
imports: import contextlib
  import datetime
  from itertools import chain
  import os
  import time
  import threading
  from snakemake.logging import logger
label_desc: Use image node_id 2 for calling the BenchmarkTimer obj's underlying member method code with example usage: obj.work() without return types