Ignore:
Timestamp:
Jan 7, 2020, 3:50:56 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
580c11b
Parents:
846c026
Message:

update existing benchmarks for changes to bench.h, add new benchmarks in new programming languages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/ctxswitch/JavaThread.java

    r846c026 rb4107c8  
    2626        static int x = 2;
    2727
    28         static private final int NoOfTimes = Integer.parseInt("1000000") ;
     28        static private int times = Integer.parseInt("100000");
    2929
    3030        public static void helper() {
    31                 for(int i = 1; i <= NoOfTimes; i += 1) {
     31                for(int i = 1; i <= times; i += 1) {
    3232                        Thread.yield();
    3333                }
     
    3737                helper();
    3838                long end = System.nanoTime();
    39                 System.out.println( (end - start) / NoOfTimes );
     39                System.out.println( (end - start) / times );
    4040        }
    4141        public static void main(String[] args) throws InterruptedException {
    42                 for (int n = Integer.parseInt("5"); --n >= 0 ; ) {
     42                if ( args.length > 2 ) System.exit( 1 );
     43                if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
     44
     45                for (int i = Integer.parseInt("5"); --i >= 0 ; ) {
    4346                        InnerMain();
    44                         Thread.sleep(2000);     // 2 seconds
     47                        Thread.sleep(2000);     // 2 seconds
    4548                        x = nextRandom(x);
    4649                }
     
    4851        }
    4952}
     53
     54// Local Variables: //
     55// tab-width: 4 //
     56// End: //
Note: See TracChangeset for help on using the changeset viewer.