1 // Test that Thread.sleep() works.
3 public class Thread_Sleep
5 public static void main(String args[])
9 long start = System.currentTimeMillis();
10 System.out.println("sleeping");
12 long end = System.currentTimeMillis();
13 if ((end - start) < 50)
14 System.out.println ("failed");
16 System.out.println("ok");
18 catch (InterruptedException x)
20 System.out.println("error: Thread interrupted.");