class_docstr: A running stat for conveniently logging the duration of a code block.
  
  Example:
      wait_timer = TimerStat()
      with wait_timer:
          ray.wait(...)
  
  Note that this class is *not* thread-safe.
class_docstr_tok: ["A","running","stat","for","conveniently","logging","the","duration","of","a","code","block",".","Example",":","wait_timer","=","TimerStat","(",")","with","wait_timer",":","ray.wait","(","...",")","Note","that","this","class","is","*","not","*","thread-safe","."]
code: def __init__(self, window_size=10):
      self._window_size = window_size
      self._samples = []
      self._units_processed = []
      self._start_time = None
      self._total_time = 0.0
      self.count = 0
  
file_path: ray/python/ray/util/timer.py
imports: import time
label_desc: Use image node_id 1 to create a new _Timer object  with example: obj = _Timer(window_size)