List of usage examples for java.lang InterruptedException printStackTrace
public void printStackTrace()
From source file:Main.java
public static void shutdownPoolAndAwaitTermination(ThreadPoolExecutor pool) { try {//from w w w. j av a2s . com pool.shutdown(); pool.awaitTermination(1000, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } }
From source file:Main.java
public static void stop(ExecutorService executor) { try {/*from w w w .j a v a 2 s .c o m*/ executor.shutdown(); executor.awaitTermination(60, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } }
From source file:Main.java
public static void delayFor(long time) { if (time <= 0) { return;/*from ww w . ja v a2 s. c o m*/ } try { Thread.sleep(time); } catch (InterruptedException e) { e.printStackTrace(); } }
From source file:Main.java
public static void sleep(int time) { try {//from www. j av a 2 s .com Thread.sleep(time); } catch (InterruptedException e) { e.printStackTrace(); } }
From source file:Main.java
public static void sleep(int i) { try {//from w w w . ja va 2 s .c om Thread.sleep(i); } catch (InterruptedException ignore) { ignore.printStackTrace(); } }
From source file:Main.java
public static void sleep(final int seconds) { try {//from ww w . j a va2 s. c o m Thread.sleep(seconds * 1000); } catch (final InterruptedException e) { e.printStackTrace(); } }
From source file:Main.java
public static void sleep(int sleep) { try {//from ww w .java 2 s . c om Thread.sleep(sleep); } catch (InterruptedException e) { e.printStackTrace(); } }
From source file:Main.java
public static void sleep(double sleep) { try {/*w ww. ja v a 2 s. c om*/ Thread.sleep((long) sleep); } catch (InterruptedException e) { e.printStackTrace(); } }
From source file:Main.java
/** * This method make ANR/* w w w.j av a2 s . c o m*/ */ public static void anr() { // for (int i = 1, n = 0; i > n; i++) { // Log.d(TAG, "i=" + i + ", n=" + n); // } try { Thread.sleep(DateUtils.SECOND_IN_MILLIS * 12); } catch (InterruptedException e) { e.printStackTrace(); } }
From source file:Main.java
/** * Cause this thread to sleep for specified amount of time while other threads run. *///from w w w. jav a 2 s. c om public static void sleep(int millis) { if (millis > 0) { try { Thread.sleep(millis); } catch (InterruptedException e) { e.printStackTrace(); } } }