class_docstr: An internal timer.
class_docstr_tok: ["An","internal","timer","."]
docstr: Stop the timer.
docstr_tok: ["Stop","the","timer","."]
code: def stop(self, sync_func: Callable = None):
      """Stop the timer."""
      assert self.started, f"timer {self.name} is not started."
      if sync_func:
          sync_func()
  
      stop_time = time.perf_counter()
      self.costs.append(stop_time - self.start_time)
      self.stop_times.append(stop_time)
      self.started = False
  
file_path: deepspeedexamples/inference/huggingface/zero_inference/timer.py
imports: from collections import namedtuple
  import time
  from typing import Callable, Any
label_desc: Use image node_id 3 for calling the _Timer obj's underlying member method code with example usage: obj.stop(sync_func) without return types