code: def profile(config, name, func, result_dict, synchromize):
      # Warm-up
      func()
      synchromize()
  
      # Profile
      start_0 = time.time()
      result = 0
      count = 0
      while time.time() < start_0 + 1.0 or count < 100:
          start = time.time()
          func()
          synchromize()
          stop = time.time()
          result += stop - start
          count += 1
  
      t = result * 1000 / count
  
      logger.log(99, "%s %f(ms)" % (name, t))
      result_dict[name] = t
      return result_dict
  
file_path: nnabla/python/src/nnabla/utils/cli/profile.py
imports: from __future__ import print_function
  import os
  import time
  from collections import OrderedDict
  from functools import partial
  import nnabla.utils.callback
  import nnabla.utils.load
  import numpy
  from contextlib2 import ExitStack
  from nnabla.ext_utils import import_extension_module
  from nnabla.logger import logger
  from nnabla.utils.cli.utility import let_data_to_variable
  from nnabla.utils.progress import configure_progress, progress
label_desc: Use image node_id 1 for calling a global function with example usage: profile(config, name, func, result_dict, synchromize) and returns: result_dict