alternate version of micro2 that gathers results of every micro task shows that even...
[IRC.git] / Robust / src / Benchmarks / oooJava / micro2.5 / test.java
1 public class test {
2
3   public static void main( String argv[] ) {
4     
5     long count = 500000;
6     
7     if( argv.length > 0 ) {
8       count = count * Integer.parseInt( argv[0] );
9     }
10             
11     long s = System.currentTimeMillis();
12     long e1;
13     long e2;
14
15    
16     rblock parent {
17
18       long y = 0;
19       
20       for( long i = 0; i < count; i++ ) {
21
22         // the subsequent sibling has a dependence
23         // on the first
24         rblock child1 {
25           long x = 3;
26         }
27
28         rblock child2 {
29           if( x + 4 == 7 ) {
30             ++y;
31           }
32         }
33
34       }
35       e1 = System.currentTimeMillis();
36       long z = 1;
37     }
38     // just read vars so compile doesn't throw them out
39     // and force parent of parent to depend on z, for
40     // timing
41     System.out.println( "ignore: "+z+", "+y );
42     e2 = System.currentTimeMillis();
43
44
45     double dt1 = ((double)e1-s)/(Math.pow( 10.0, 3.0 ) );
46     double dt2 = ((double)e2-s)/(Math.pow( 10.0, 3.0 ) );
47     System.out.println( "dt to parent done   ="+dt1+"s" );
48     System.out.println( "dt to parent retired="+dt2+"s" );
49   }
50 }