code: def timer(func):
      
      name = func.__name__
  
      @wraps(func)
      def timed_func(self, *args, **kwargs):  # pylint: disable=missing-docstring
          _start = time.time()
          out = func(self, *args, **kwargs)
          self.log(2, '{0} took {1:.1f} sec'.format(name, time.time() - _start))
          return out
  
      return timed_func
docs: Time a method and print its duration after return