code: def bench(t1, t2):
      bench_times = []
      for _ in range(NUM_REPEAT_OF_REPEATS):
          with PerfContext() as pc:
              for _ in range(NUM_REPEATS):
                  torch.add(t1, t2)
          bench_times.append(pc.total_time)
  
      bench_time_min = (
          float(torch.min(torch.Tensor(bench_times))) / NUM_REPEATS
      )
      bench_time_avg = float(torch.sum(torch.Tensor(bench_times))) / (
          NUM_REPEATS * NUM_REPEAT_OF_REPEATS
      )
      bench_time_med = (
          float(torch.median(torch.Tensor(bench_times))) / NUM_REPEATS
      )
      bench_std = (
          float(torch.std(torch.Tensor(bench_times))) / NUM_REPEATS
      )
      return bench_time_min, bench_time_avg, bench_time_med, bench_std
  
file_path: MONAI/tests/profile_subclass/profiling.py
imports: from __future__ import annotations
  import argparse
  import torch
  from min_classes import SubTensor, SubWithTorchFunc
  from monai.data import MetaTensor
  from monai.utils.profiling import PerfContext
label_desc: Use image node_id 1 for calling a global function with example usage: bench(t1, t2) and returns: bench_time_min,  bench_time_avg,  bench_time_med,  bench_std