blob: 450be2fae38e938474c154adaf31db4771615575 [file] [log] [blame]
The Android Open Source Project2ad60cf2008-10-21 07:00:00 -07001public class Main {
2 static public void main(String[] args) throws Exception {
3 int millis = 1000;
4
5 if (args.length != 0) {
6 millis = Integer.parseInt(args[0]);
7 }
8
9 System.out.println("Sleeping " + millis + " msec...");
10
11 long start = System.currentTimeMillis();
12 Thread.sleep(millis);
13 long elapsed = System.currentTimeMillis() - start;
14 long offBy = Math.abs(elapsed - millis);
15
16 System.out.println("Done sleeping");
17
18 if (offBy > 250) {
19 System.out.println("Actually slept about " + elapsed + " msec...");
20 }
21 }
22}