Changeset b7d6a36 for benchmark/creation/JavaThread.java
- Timestamp:
- Feb 20, 2020, 4:15:51 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6a490b2
- Parents:
- dca5802 (diff), 2cbfe92 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/creation/JavaThread.java
rdca5802 rb7d6a36 26 26 static int x = 2; 27 27 28 static private final int NoOfTimes = Integer.parseInt("10000") ;28 static private int times = Integer.parseInt("10000") ; 29 29 30 30 public static class MyThread extends Thread { … … 33 33 } 34 34 public static void helper() throws InterruptedException { 35 for(int i = 1; i <= NoOfTimes; i += 1) {35 for(int i = 1; i <= times; i += 1) { 36 36 MyThread m = new MyThread(); 37 37 x = nextRandom( x ); … … 44 44 helper(); 45 45 long end = System.nanoTime(); 46 System.out.println( (end - start) / NoOfTimes );46 System.out.println( (end - start) / times ); 47 47 } 48 48 public static void main(String[] args) throws InterruptedException { 49 for (int n = Integer.parseInt("5"); --n >= 0 ; ) { 49 if ( args.length > 2 ) System.exit( 1 ); 50 if ( args.length == 2 ) { times = Integer.parseInt(args[1]); } 51 52 for (int i = Integer.parseInt("5"); --i >= 0 ; ) { 50 53 InnerMain(); 51 Thread.sleep(2000); 54 Thread.sleep(2000); // 2 seconds 52 55 x = nextRandom(x); 53 56 } … … 55 58 } 56 59 } 60 61 // Local Variables: // 62 // tab-width: 4 // 63 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.