* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / tests / sleep.java
1 import java.util.*;
2
3 public class sleep extends Thread {
4     public static Random r = new Random();
5
6     public sleep (String name) {
7         super(name);
8     }
9
10     public void run() {
11         for (int i = 0; i < 10; ++i) {
12             System.out.println(getName());
13             try {
14                 sleep((long) (r.nextFloat() * 1000));
15             } catch (Exception e) {
16                 e.printStackTrace();
17             }
18         }
19     }
20
21     public static void main(String args[]) {
22         sleep t1 = new sleep("a");
23         sleep t2 = new sleep("b");
24
25         t1.start();
26         t2.start();
27     }
28 }