Invokes wait until the elapsed time has passed.  In the thread is interrupted, the interrupt is ignored.
@param milli Length of desired pause in milliseconds.
764109
public static void pause(long milli) {
		final Thread t = Thread.currentThread();
		long start = System.currentTimeMillis();
		while( System.currentTimeMillis() - start < milli ) {
			synchronized( t )  {
				try {
					long target = milli - (System.currentTimeMillis() - start);
					if( target > 0 )
						t.wait(target);
				} catch (InterruptedException ignore) {
				}
			}
		}
	}
1201034
public static void wait(Object lock, long timeout) {
	try {
	    synchronized (lock) {
		lock.wait(timeout);
	    }
	}
	catch (InterruptedException e) {}
    }
960665
final void internalWait(long timeout) {
    int s;
    if ((s = status) >= 0 && // force completer to issue notify
        U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
      synchronized (this) {
        if (status >= 0)
          try {
            wait(timeout);
          } catch (InterruptedException ie) {
          }
        else
          notifyAll();
      }
    }
  }
1043730
private static void wait(Object lock, int timeout)
  {
    try {
      lock.wait(timeout);
    }
    catch(InterruptedException unused) {
      Thread.currentThread().interrupt();
    }
  }
1117456
private void delay(long multiplier) {
        try {
            // Wait for the timeout to finish
            Thread.sleep(TimeUnit.SECONDS.toMillis(RETRY_DELAY * multiplier));
        } catch (InterruptedException ex) {
            // Doesn't matter if we're interrupted
        }
    }
882053
public void waitAllThreadComplete(int waitInMillis) {
		for (int i=0; i<pool.length; i++) {
			if (pool[i] != null && pool[i].isAlive()) {
				try {
					pool[i].join(waitInMillis);
				} catch (InterruptedException e) {
				}
			}
		}
	}
561727
public void start(long millisecond) {
        if (millisecond <= 0) return;

        mPreviousIntervalCallbackTime = 0;

        if (null != mCustomCountDownTimer) {
            mCustomCountDownTimer.stop();
            mCustomCountDownTimer = null;
        }

        long countDownInterval;
        if (mCountdown.isShowMillisecond) {
            countDownInterval = 10;
            updateShow(millisecond);
        } else {
            countDownInterval = 1000;
        }

        mCustomCountDownTimer = new CustomCountDownTimer(millisecond, countDownInterval) {
            @Override
            public void onTick(long millisUntilFinished) {
                updateShow(millisUntilFinished);
            }

            @Override
            public void onFinish() {
                // countdown end
                allShowZero();
                // callback
                if (null != mOnCountdownEndListener) {
                    mOnCountdownEndListener.onEnd(CountdownView.this);
                }
            }
        };
        mCustomCountDownTimer.start();
    }
1130300
protected void waitFor(final int millis) {
		synchronized (mLock) {
			try {
				sendLogBroadcast(DfuBaseService.LOG_LEVEL_DEBUG, "wait(" + millis + ")");
				mLock.wait(millis);
			} catch (final InterruptedException e) {
				loge("Sleeping interrupted", e);
			}
		}
	}
941720
@ResponseOverride(
            description = "Slow Down Response",
            parameters = {"Delay Time (milliseconds)"})
    public static void delay(PluginArguments args, Integer milliseconds) throws Exception {
        Thread.sleep(milliseconds);
    }
796216
public void sleep(Deadline deadline)
	{
		final long millis = Math.min(deadline.getTimeLeft(), getMilliseconds());

		if (millis > 0)
		{
			try
			{
				Thread.sleep(millis);
			}
			catch (InterruptedException e)
			{
				// ignore but return
			}
		}
	}
1046168
protected final void doWait(double seconds)
    {
        try
        {
            long ms = (long)(seconds * 1000l);
            synchronized (this)
            {
                wait(ms);
            }
        }
        catch (InterruptedException ie)
        {
            log.debug("BackgroundProcess thread interuptted.");
        }
    }
127735
public void waitForBuffer(long timeoutMilli) {
        //assert(callerProcessing.booleanValue() == false);

        synchronized(buffer) {
            if( dirtyBuffer )
                return;
            if( !foundEOF() ) {
                logger.trace("Waiting for things to come in, or until timeout");
                try {
                    if( timeoutMilli > 0 )
                        buffer.wait(timeoutMilli);
                    else
                        buffer.wait();
                } catch(InterruptedException ie) {
                    logger.trace("Woken up, while waiting for buffer");
                }
                // this might went early, but running the processing again isn't a big deal
                logger.trace("Waited");
            }
        }
    }
1314870
public synchronized long delay() {
        while (true) {
            long curTimeMs = System.currentTimeMillis();
            long millisSinceLastSecond = curTimeMs % 1000;
            long nowInMsRoundedAtSec = curTimeMs - millisSinceLastSecond;
            checkNextSecond(nowInMsRoundedAtSec);
            int delayMs = getDelay(millisSinceLastSecond);

            if (stopping) {
                delayMs = delayMs > 0 ? 10 : 0;
                notify(); // NOSONAR Don't notifyAll as cost is too big in terms of performances
            }

            if (delayMs < 1) {
                notify(); // NOSONAR Don't notifyAll as cost is too big in terms of performances
                break;
            }
            cntDelayed++;
            try {
                wait(delayMs);
            } catch (InterruptedException ex) {
                log.debug("Waiting thread was interrupted", ex);
                Thread.currentThread().interrupt();
            }
            cntDelayed--;
        }
        cntSent++;
        return 0;
    }
1043392
@Override
    public IPromise timeoutIn(long millis) {
        final Actor actor = Actor.sender.get();
        if ( actor != null )
            actor.delayed(millis, ()-> timedOut(Timeout.INSTANCE));
        else {
            Actors.delayedCalls.schedule( new TimerTask() {
                @Override
                public void run() {
                    timedOut(Timeout.INSTANCE);
                }
            },millis);
        }
        return this;
    }
458678
public void await(Event event, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
        long timestamp = getTimestamp(event);
        try {
            lock.lockInterruptibly();
            single(timestamp);
            while (isPermit(event, timestamp) == false) {
                condition.await(timeout, unit);
            }
        } finally {
            lock.unlock();
        }
    }
1278567
void waitForResuming() throws IOException
   {
      if (isSuspended.get())
      {
         try
         {
            latcher.get().await();
         }
         catch (InterruptedException e)
         {
            throw new IOException(e);
         }
      }
   }
549264
@Override
    public final synchronized void stopService(long millis) {
        running = false;
        try {
            if (keepRunning) {
                keepRunning = false;
                interrupt();
                quit();
                if (0L == millis) {
                    join();
                } else {
                    join(millis);
                }
            }
        } catch (InterruptedException e) {
            //its possible that the thread exits between the lines keepRunning=false and interrupt above
            log.warn("Got interrupted while stopping {}", this, e);

            Thread.currentThread().interrupt();
        }
    }