OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [Thread_Sleep.java] - Blame information for rev 767

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
// Test that Thread.sleep() works.
2
 
3
public class Thread_Sleep
4
{
5
  public static void main(String args[])
6
  {
7
    try
8
    {
9
      long start = System.currentTimeMillis();
10
      System.out.println("sleeping");
11
      Thread.sleep(50);
12
      long end = System.currentTimeMillis();
13
      if ((end - start) < 50)
14
        System.out.println ("failed");
15
      else
16
        System.out.println("ok");
17
    }
18
    catch (InterruptedException x)
19
    {
20
      System.out.println("error: Thread interrupted.");
21
    }
22
  }
23
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.