code: def evalTime(f, v, script=False, loops=1000):
      min = 1e10
      for i in range(0, loops):
          t0 = time.perf_counter()
          f(v)
          dt = time.perf_counter() - t0
          min = dt if dt < min else min
      if not script:
          print(f" run time in {int(loops)} loops was {min:2.9f} sec")
      return min
  
file_path: pytensor/pytensor/misc/elemwise_time_test.py
imports: import sys
  import time
  from optparse import OptionParser
  import numpy
  import pytensor
  from pytensor.configdefaults import config
  from pytensor.tensor.math import tanh
  from pytensor.tensor.type import vector
label_desc: Use image node_id 1 for calling a global function with example usage: evalTime(f, v, script, loops) and returns: min