class_docstr: Handler for Ignite Engine classes which measures the time from a start event ton an end event. This can be used to
  profile epoch, iteration, and other events as defined in `ignite.engine.Events`. This class should be used only
  within the context of a profiler object.
  
  Args:
      name: name of event to profile
      profiler: instance of WorkflowProfiler used by the handler, should be within the context of this object
      start_event: item in `ignite.engine.Events` stating event at which to start timing
      end_event: item in `ignite.engine.Events` stating event at which to stop timing
class_docstr_tok: ["Handler","for","Ignite","Engine","classes","which","measures","the","time","from","a","start","event","ton","an","end","event",".","This","can","be","used","to","profile","epoch",",","iteration",",","and","other","events","as","defined","in","`","ignite.engine.Events","`",".","This","class","should","be","used","only","within","the","context","of","a","profiler","object",".","Args",":","name",":","name","of","event","to","profile","profiler",":","instance","of","WorkflowProfiler","used","by","the","handler",",","should","be","within","the","context","of","this","object","start_event",":","item","in","`","ignite.engine.Events","`","stating","event","at","which","to","start","timing","end_event",":","item","in","`","ignite.engine.Events","`","stating","event","at","which","to","stop","timing"]
code: def attach(self, engine):
      engine.add_event_handler(self.start_event, self.start)
      engine.add_event_handler(self.end_event, self.end)
      return self
  
imports: from __future__ import annotations
  import csv
  import datetime
  import multiprocessing
  import os
  import sys
  import threading
  from collections import defaultdict, namedtuple
  from contextlib import contextmanager
  from functools import wraps
  from inspect import getframeinfo, stack
  from queue import Empty
  from time import perf_counter, perf_counter_ns
  from typing import TYPE_CHECKING, Any, cast
  import numpy
  import torch
  from monai.utils import optional_import
label_desc: Use image node_id 2 for calling the ProfileHandler obj's underlying member method code with example usage: obj.attach(engine) and returns: self