class_docstr: Context manager for tracking how much time is spent within context blocks. This uses `time.perf_counter` to
  accumulate the total amount of time in seconds in the attribute `total_time` over however many context blocks
  the object is used in.
class_docstr_tok: ["Context","manager","for","tracking","how","much","time","is","spent","within","context","blocks",".","This","uses","`","time.perf_counter","`","to","accumulate","the","total","amount","of","time","in","seconds","in","the","attribute","`","total_time","`","over","however","many","context","blocks","the","object","is","used","in","."]
code: def __init__(self):
      self.total_time: float = 0
      self.start_time: float | None = None
  
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 1 to create a new PerfContext object  with example: obj = PerfContext()