code: def timeit(func):
      """
      Use this decorator on a method to find it's execution time.
      :param func:
      :return:
      """
  
      @wraps(func)
      def time_and_log(*args, **kwargs):
          start = time.time()
          start_cpu = time.clock()
          result = func(*args, **kwargs)
          end = time.time()
          end_cpu = time.clock()
          print(
              "func: %r took a total of %2.4f sec to run and %2.4f sec of CPU time\n",
              (func.__name__, (end - start), (end_cpu - start_cpu)),
          )
          return result
  
      return time_and_log
  
label_desc: Use image node_id 1 for calling a global function with example usage: timeit(func) and returns: time_and_log, result