class_docstr: This is used to measure the time it takes for an inference model to perform preprocessing and then the model
  processing. After initializing the object, the record() method needs to be called at the timing checkpoints.
  When finished, Benchmarker.summary() will return the recorded times for the preprocessing stage and model
  processing stage.
  
  init            dataset         forward (depr)   formatted
    |     proc       |     ph         |       ph      |
    |                |     lm         |               |
    
class_docstr_tok: ["This","is","used","to","measure","the","time","it","takes","for","an","inference","model","to","perform","preprocessing","and","then","the","model","processing",".","After","initializing","the","object",",","the","record","(",")","method","needs","to","be","called","at","the","timing","checkpoints",".","When","finished",",","Benchmarker.summary","(",")","will","return","the","recorded","times","for","the","preprocessing","stage","and","model","processing","stage",".","init","dataset","forward","(","depr",")","formatted","|","proc","|","ph","|","ph","|","|","|","lm","|","|"]
code: def calc_duration(self, start, end):
      if (
          type(start) == torch.cuda.Event
          and type(end) == torch.cuda.Event
      ):
          return start.elapsed_time(end) / 1000
      else:
          return end - start
  
imports: import hashlib
  import json
  import logging
  import random
  import os
  import signal
  import numpy
  import torch
  import torch.distributed
  from requests.exceptions import ConnectionError
  from torch import multiprocessing
  import mlflow
  from copy import deepcopy
  import pandas
  from tqdm import tqdm
  import time
  import pickle
  from farm.visual.ascii.images import WELCOME_BARN, WORKER_M, WORKER_F, WORKER_X
label_desc: Use image node_id 4 for calling the Benchmarker obj's underlying member method code with example usage: obj.calc_duration(start, end) and returns: unknown, unknown