blob: 55032fd0a7edb8e3c7ce008c609565346401a841 [file] [log] [blame]
public class Main {
static public void main(String[] args) throws Exception {
int millis = 1000;
if (args.length > 1) {
millis = Integer.parseInt(args[1]);
}
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...");
}
}
}