class_docstr: A simple timer.
class_docstr_tok: ["A","simple","timer","."]
code: def toc(self, average=True):
      self.diff = time.time() - self.start_time
      self.total_time += self.diff
      self.calls += 1
      self.average_time = self.total_time / self.calls
      if average:
          return self.average_time
      else:
          return self.diff
  
file_path: dense-pose/detectron/utils/timer.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import time
label_desc: Use image node_id 3 for calling the Timer obj's underlying member method code with example usage: obj.toc(average) and returns: self, self