Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/mutex/JavaThread.java

    rb4107c8 rbe53b87  
    2626        static int x = 2;
    2727
    28         static private int times = Integer.parseInt("100000000");
     28        static private final int NoOfTimes = Integer.parseInt("100000000") ;
    2929
    3030        public synchronized void noop() {
     
    3535                // Inhibit biased locking ...
    3636                x = (j.hashCode() ^ System.identityHashCode(j)) | 1 ;     
    37                 for(int i = 1; i <= times; i += 1) {
     37                for(int i = 1; i <= NoOfTimes; i += 1) {
    3838                        x = nextRandom(x);
    3939                        j.noop();
     
    4444                helper();
    4545                long end = System.nanoTime();
    46                 System.out.println( (end - start) / times );
     46                System.out.println( (end - start) / NoOfTimes );
    4747        }
    4848        public static void main(String[] args) throws InterruptedException {
    49                 if ( args.length > 2 ) System.exit( 1 );
    50                 if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
    51 
    5249                for (int n = Integer.parseInt("5"); --n >= 0 ; ) {
    5350                        InnerMain();
     
    5855        }
    5956}
    60 
    61 // Local Variables: //
    62 // tab-width: 4 //
    63 // End: //
Note: See TracChangeset for help on using the changeset viewer.