Stop program execution for nn millis.

@param millis the number of millis-seconds to wait for, <code>0</code> stops program forever.
971623
private void waitFor( long millis )
    {
        Object lock = new Object();
        synchronized ( lock )
        {
            try
            {
                lock.wait( millis );
            }
            catch ( InterruptedException e )
            {
                Thread.currentThread().interrupt(); // good practice if don't throw
                getLog().warn( "Spuriously interrupted while waiting for " + millis + "ms", e );
            }
        }
    }
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");
            }
        }
    }
203561
public void sleep(String sleepMillis) throws NumberFormatException {

        try {
            Thread.sleep(Long.parseLong(sleepMillis));
        } catch (InterruptedException e) {
            // ignore
        }
    }
201402
public Retryer<R> stopAfterDelay(final long delayInMillis) {
        checkArgument(delayInMillis >= 0L, "delayInMillis must be >= 0 but is %d", delayInMillis);
        return withStopStrategy(new StopStrategy() {
            
            @Override public boolean shouldStop(int previousAttemptNumber, long delaySinceFirstAttemptInMillis) {
                return delaySinceFirstAttemptInMillis >= delayInMillis;
            }
        });
    }
214011
public void setNetworkTimeout(Executor executor, final int milliseconds) throws SQLException {
    if (this.isClosed()) {
      throw ExceptionMapper
          .getSqlException("Connection.setNetworkTimeout cannot be called on a closed connection");
    }
    if (milliseconds < 0) {
      throw ExceptionMapper
          .getSqlException("Connection.setNetworkTimeout cannot be called with a negative timeout");
    }
    SQLPermission sqlPermission = new SQLPermission("setNetworkTimeout");
    SecurityManager securityManager = System.getSecurityManager();
    if (securityManager != null) {
      securityManager.checkPermission(sqlPermission);
    }
    try {
      stateFlag |= ConnectionState.STATE_NETWORK_TIMEOUT;
      protocol.setTimeout(milliseconds);
    } catch (SocketException se) {
      throw ExceptionMapper.getSqlException("Cannot set the network timeout", se);
    }
  }
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);
			}
		}
	}
608881
public static void awaitTermination(ExecutorService executorService,
            long timeoutMillis) {
        if (executorService.isTerminated())
            return;
        log.info("Start Terminating !!! - {}, timeoutMillis - {}",
                executorService, timeoutMillis);
        long startTimeMillis = System.currentTimeMillis();
        try {
            executorService
                    .awaitTermination(timeoutMillis, TimeUnit.MILLISECONDS);
        } catch (InterruptedException e) {
            log.warn("Timeout Occur !!! - {}, timeoutMillis - {}",
                    executorService, timeoutMillis);
        }
        log.info("Terminated !!! - {} took {} ms", executorService,
                startTimeMillis - System.currentTimeMillis());
    }
954324
synchronized void stop(){
        if(status.equals("stopped"))
            return;
        long t = System.currentTimeMillis();
        run = false;

        try {
            serverSocket.close();
        } catch (IOException e) {
            throw S1SystemError.wrap(e);
        }

        executor.shutdown();
        while (!executor.isTerminated()) {
        }

        status = "stopped";
        LOG.info("Node "+nodeId+" file server stopped ("+(System.currentTimeMillis()-t)+" ms.)");
    }
15664
public void stopTime() {
    this.elapsedTime = System.currentTimeMillis() - this.startTime;
    this.elapsedCpuTime = (ManagementFactory.getThreadMXBean().getCurrentThreadCpuTime() - this.startCpuTime)/1000000;
  }
388817
@Override
  public void stop() {
    if (!mIsRunning) {
      return;
    }
    mIsRunning = false;
    mStartTimeMs = 0;
    mExpectedRenderTimeMs = mStartTimeMs;
    mLastFrameAnimationTimeMs = -1;
    mLastDrawnFrameNumber = -1;
    unscheduleSelf(mInvalidateRunnable);
    mAnimationListener.onAnimationStop(this);
  }
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;
    }
749341
public static void sleep(long millis) throws InterruptedException {
        while (millis > 0) {
            // abort if the user kills mlcp in local mode
            String shutdown = System.getProperty("mlcp.shutdown");
            if (shutdown != null) {
                break;
            }
            if (millis > 1000) {
                Thread.sleep(1000);
                millis -= 1000;
            } else {
                Thread.sleep(millis);
                millis = 0;
            }
        }
    }
118235
public void stop() {
        if (mMonitorStarted) {
            mMonitorStarted = false;
            Looper.getMainLooper().setMessageLogging(null);
            mBlockCanaryCore.stackSampler.stop();
            mBlockCanaryCore.cpuSampler.stop();
        }
    }
239741
public static void sleep(int millis) {
		long end = System.currentTimeMillis() + millis;
		boolean interrupted = Thread.interrupted();
		int remain = millis;
		while (remain > 0) {
			try {
				Thread.sleep(remain);
				break;
			} catch (InterruptedException e) {
				interrupted = true;
				remain = (int) (end - System.currentTimeMillis());
			}
		}
		if (interrupted) {
			Thread.currentThread().interrupt();
		}
	}
490081
@Override
    public synchronized void stopChain(String chainName, long millisec) throws ChannelException, ChainException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "stopChain: " + chainName + " time=" + millisec);
        }
        if (null == chainName) {
            throw new InvalidChainNameException("Null chain name");
        }
        if (millisec < 0) {
            throw new ChainTimerException("Invalid time length give to stopChain, " + millisec);
        }

        // Verify the chain is found in the runtime.
        Chain chain = getRunningChain(chainName);
        if (null == chain) {
            // Due to timing windows (i.e. multiple channel providers going away), there is
            // a race to stop chains. This is not a notable condition: the chain can only be stopped
            // once.
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "stopChain " + chainName, "chain is not running");
            }
            return;
        }

        // Ensure we have an inbound chain.
        if (FlowType.OUTBOUND.equals(chain.getChainData().getType())) {
            throw new InvalidChainNameException("Outbound chain cannot use this interface.");
        }

        stopChainInternal(chain, millisec);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "stopChain");
        }
    }
77304
public static void delay(int ms, int nanos) {
    try {
      Thread.sleep(ms, nanos);
    } catch (InterruptedException e) {
      throw new RuntimeException("Interrupted", e);
    }
  }
947690
def stop(self, timeout: int = 5) -> None:
        
        self.running = False
        start = time.perf_counter()
        while True:
            if self.getsCounter == 0:
                return True
            elif time.perf_counter() <= start + timeout:
                time.sleep(.1)
            else:
                raise StopTimeout("Stop timed out waiting for {} gets to "
                                  "complete.".format(self.getsCounter))