code: def timeit (func, log, limit):
      
  
      def newfunc (*args, **kwargs):
          """Execute function and print execution time."""
          t = time.time()
          res = func(*args, **kwargs)
          duration = time.time() - t
          if duration > limit:
              print(func.__name__, "took %0.2f seconds" % duration, file=log)
              print(args, file=log)
              print(kwargs, file=log)
          return res
      return update_func_meta(newfunc, func)
docs: Print execution time of the function. For quick'n'dirty profiling.