Java tutorial
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt public class Main { /** * * "waitTimeBool" wait for the given time. * * @param object wait() will be start on this given object * @param time * @throws InterruptedException when interrupted */ public static void waitTimeExcept(Object object, long time) throws InterruptedException { synchronized (object) { object.wait(time); } } /** * * "waitTimeBool" wait for the given time. * * @param time * @throws InterruptedException when interrupted */ public static void waitTimeExcept(long time) throws InterruptedException { synchronized (Thread.currentThread()) { Thread.currentThread().wait(time); } } }