Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static void waitUntil(Calendar time) { waitUntil(time.getTimeInMillis()); } public static void waitUntil(long millis) { waitMillis(millis - System.currentTimeMillis()); } public static void waitMillis(long millis) { try { Thread.sleep(millis); } catch (Exception e) { } } }