class_docstr: A context manager that tracks call count and latency, and other stats.
  
  Usage:
      sw = stopwatch.Stopwatch()
      with sw("foo"):
        foo()
      with sw("bar"):
        bar()
      @sw.decorate
      def func():
        pass
      func()
      print(sw)
class_docstr_tok: ["A","context","manager","that","tracks","call","count","and","latency",",","and","other","stats",".","Usage",":","sw","=","stopwatch.Stopwatch","(",")","with","sw","(","``","foo","''",")",":","foo","(",")","with","sw","(","``","bar","''",")",":","bar","(",")","@","sw.decorate","def","func","(",")",":","pass","func","(",")","print","(","sw",")"]
code: def add(self, name, duration):
      self._times[name].add(duration)
  
imports: import collections
  import functools
  import math
  import os
  import sys
  import threading
  import time
label_desc: Use image node_id 12 for calling the StopWatch obj's underlying member method code with example usage: obj.add(name, duration) without return types