blob: c1a2d83c52eb0f4c20569e0aba6be30e5e193aae [file] [log] [blame]
public class Main {
static public void main(String[] args) throws Exception {
int millis = 1000;
if (args.length != 0) {
millis = Integer.parseInt(args[0]);
}
System.out.println("Sleeping " + millis + " msec...");
long start = System.currentTimeMillis();
Thread.sleep(millis);
long elapsed = System.currentTimeMillis() - start;
long offBy = Math.abs(elapsed - millis);
System.out.println("Done sleeping");
if (offBy > 250) {
System.out.println("Actually slept about " + elapsed + " msec...");
}
}
}