code: public static boolean sleep(long milliseconds, int nanoseconds) {
      try {
        Thread.sleep(milliseconds, nanoseconds);
        return true;
      }
      catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        return false;
      }
    }
docs: Causes the current Thread to sleep for the specified number of milliseconds and nanoseconds.  If the current Thread
  is interrupted, the sleep is aborted, however, the interrupt bit is reset and this method returns false.
  
  @param milliseconds the number of milliseconds to cause the current Thread to sleep (sleep).  If the number
  of milliseconds is 0, then the current Thread will sleep (sleep) until interrupted.
  @param nanoseconds the number of nanoseconds in addition to the milliseconds to cause the current Thread to sleep
  (sleep).
  @return a boolean value if the sleep operation was successful without interruption.
  @see java.lang.Thread#sleep(long)
  @see java.lang.Thread#interrupt()