code: public static void sleepMs(Logger logger, long timeMs) {
      try {
        Thread.sleep(timeMs);
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        if (logger != null) {
          logger.warn(e.getMessage(), e);
        }
      }
    }
docs: Sleeps for the given number of milliseconds, reporting interruptions using the given logger.
  
  Unlike Thread.sleep(), this method responds to interrupts by setting the thread interrupt
  status. This means that callers must check the interrupt status if they need to handle
  interrupts.
  
  @param logger logger for reporting interruptions; no reporting is done if the logger is null
  @param timeMs sleep duration in milliseconds