class_docstr: Test how often some code gets reached.
  
  Example:
      Print the speed of the iteration every 100 times.
  
      .. code-block:: python
  
          speed = IterSpeedCounter(100)
          for k in range(1000):
              # do something
              speed()
class_docstr_tok: ["Test","how","often","some","code","gets","reached",".","Example",":","Print","the","speed","of","the","iteration","every","100","times",".","..","code-block",":",":","python","speed","=","IterSpeedCounter","(","100",")","for","k","in","range","(","1000",")",":","#","do","something","speed","(",")"]
docstr: Args:
      print_every(int): interval to print.
      name(str): name to used when print.
docstr_tok: ["Args",":","print_every","(","int",")",":","interval","to","print",".","name","(","str",")",":","name","to","used","when","print","."]
code: def __init__(self, print_every, name=None):
      """
      Args:
          print_every(int): interval to print.
          name(str): name to used when print.
      """
      self.cnt = 0
      self.print_every = int(print_every)
      self.name = name if name else "IterSpeed"
  
imports: import atexit
  from collections import defaultdict
  from contextlib import contextmanager
  from time import perf_counter
  from .None import logger
  from .stats import StatCounter
label_desc: Use image node_id 1 to create a new IterSpeedCounter object from inherited base classes: object with example: obj = IterSpeedCounter(print_every, name)