Java examples for java.lang:Exception
Sleep for seconds seconds, without the exceptions
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int seconds = 2; sleepSeconds(seconds);/*from ww w. j av a 2 s.c o m*/ } /** * Sleep for <i>seconds</i> seconds, without the exceptions * */ public final static void sleepSeconds(int seconds) { sleep(seconds * 1000); } /** * Same as Thread.sleep(), but without the exceptions * */ public final static void sleep(long milliseconds) { try { Thread.sleep(milliseconds); } catch (Exception ex) { } } }