Java Thread Pause pause (final int msec)

Here you can find the source of pause (final int msec)

Description

A basic sleep where you don't care about the interrupted exception.

License

Apache License

Parameter

Parameter Description
msec Milliseconds to seleep for

Declaration

public static void pause (final int msec)
    

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file

public class Main {
    /**//from w ww  .j a  v a  2  s  .c  om
     * A basic sleep where you don't care about the interrupted exception.
     *
     * @param msec
     *            Milliseconds to seleep for
     */
    public static void pause(final int msec) {
        if (msec > 0) {
            try {
                Thread.sleep(msec);
            } catch (final InterruptedException e) {
            }
        }
    }
}

Related

  1. pause()
  2. pause(double seconds)
  3. pause(double seconds)
  4. pause(double timeInSec)