code: def _timer(name, _logger=None, level="info"):
      
      start = tic()
      _logger = _logger or logger
      _logger.info("Starting %s", name)
      yield
      stop = tic()
      delta = datetime.timedelta(seconds=stop - start)
      _logger_level = getattr(_logger, level)
      _logger_level("Finished %s in %s", name, delta)
docs: Output execution time of a function to the given logger level
  
      Parameters
      ----------
      name : str
          How to name the timer (will be in the logs)
      logger : logging.logger
          The optional logger where to write
      level : str
          On which level to log the performance measurement