class_docstr: A ``Thread`` to monitor a specific PID with a certain frequency
  to a file
class_docstr_tok: ["A","``","Thread","``","to","monitor","a","specific","PID","with","a","certain","frequency","to","a","file"]
docstr: Core monitoring function, called by start()
docstr_tok: ["Core","monitoring","function",",","called","by","start","(",")"]
code: def run(self):
      """Core monitoring function, called by start()"""
      start_time = time()
      wait_til = start_time
      while not self._event.is_set():
          self._sample()
          wait_til += self._freq
          self._event.wait(max(0, wait_til - time()))
  
imports: import os
  import numpy
  import threading
  from time import time
  from ..None import config, logging
label_desc: Use image node_id 5 for calling the ResourceMonitor obj's underlying member method code with example usage: obj.run() without return types