code: def timeit(method):
      """
      Monitor elapsed time of the corresponding function displaying the method name.
  
      Args:
          method: function that is being measured
  
      Return:
          `timed` function for measuring the elapsed time
      """
  
      def timed(*args, **kwargs):
          ts = time.time()
          result = method(*args, **kwargs)
          te = time.time()
          if "log_time" in kwargs:
              name = kwargs.get("log_name", method.__name__.upper())
              kwargs["log_time"][name] = int((te - ts) * 1000)
          else:
              logging.info(
                  "%2.2fms %r" % ((te - ts) * 1000, method.__name__)
              )
          return result
  
      return timed
  
imports: import os
  import time
  from copy import deepcopy
  from typing import Dict
  import torch
  from omegaconf import DictConfig
  from nemo.collections.asr.models import ClusteringDiarizer
  from nemo.collections.asr.parts.utils.offline_clustering import get_scale_interpolated_embs, split_input_data
  from nemo.collections.asr.parts.utils.online_clustering import OnlineSpeakerClustering
  from nemo.collections.asr.parts.utils.speaker_utils import OnlineSegmentor, audio_rttm_map, generate_cluster_labels, get_embs_and_timestamps
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 1 for calling a global function with example usage: timeit(method) and returns: timed, result