code: public static void sleepFor(long sleepTime, TimeUnit unit) throws InterruptedException
    {
      if (Thread.interrupted()) {
        throw new InterruptedException();
      }
      if (sleepTime <= 0) {
        return;
      }
      long sleepTimeLimitNanos = System.nanoTime() + unit.toNanos(sleepTime);
      while (true) {
        long sleepTimeoutNanos = sleepTimeLimitNanos - System.nanoTime();
        if (sleepTimeoutNanos <= 0) {
          return;
        }
        LockSupport.parkNanos(sleepTimeoutNanos);
        if (Thread.interrupted()) {
          throw new InterruptedException();
        }
      }
    }
docs: Equivalent of {@link Thread#sleep(long)} with arguments and semantics of timed wait methods in classes from {@link
  java.util.concurrent} (like {@link java.util.concurrent.Semaphore#tryAcquire(long, TimeUnit)},
  {@link java.util.concurrent.locks.Lock#tryLock(long, TimeUnit)}, etc.): if the sleepTime argument is negative or
  zero, the method returns immediately. {@link Thread#sleep}, on the contrary, throws an IllegalArgumentException if
  the argument is negative and attempts to unschedule the thread if the argument is zero.
  
  @throws InterruptedException if the current thread is interrupted when this method is called or during sleeping.