def log_time(message):
  """Utility to easily log the runtime of a passage of code with a message.

  EG.
  with log_time('hello there'):
    time.sleep(1)
  # prints: hello there: 1 seconds

  Args:
    message: The message to prepend to the runtime of the code

  Yields:
    Nothing, but can be used with "with" statement.
  """
  start = time.time()
  yield
  end = time.time()
  logging.info('%s: %s seconds', message, end - start)
Utility to easily log the runtime of a passage of code with a message.

  EG.
  with log_time('hello there'):
    time.sleep(1)
  # prints: hello there: 1 seconds

  Args:
    message: The message to prepend to the runtime of the code

  Yields:
    Nothing, but can be used with "with" statement.
  
language/serene/util.py