Changeset bdfc032 for benchmark/mutex/JavaThread.java
- Timestamp:
- Feb 4, 2020, 11:35:26 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- eef8dfb
- Parents:
- aefb247 (diff), 4f7b418 (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/mutex/JavaThread.java
raefb247 rbdfc032 26 26 static int x = 2; 27 27 28 static private final int NoOfTimes = Integer.parseInt("100000000");28 static private int times = Integer.parseInt("100000000"); 29 29 30 30 public synchronized void noop() { … … 35 35 // Inhibit biased locking ... 36 36 x = (j.hashCode() ^ System.identityHashCode(j)) | 1 ; 37 for(int i = 1; i <= NoOfTimes; i += 1) {37 for(int i = 1; i <= times; i += 1) { 38 38 x = nextRandom(x); 39 39 j.noop(); … … 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 if ( args.length > 2 ) System.exit( 1 ); 50 if ( args.length == 2 ) { times = Integer.parseInt(args[1]); } 51 49 52 for (int n = Integer.parseInt("5"); --n >= 0 ; ) { 50 53 InnerMain(); … … 55 58 } 56 59 } 60 61 // Local Variables: // 62 // tab-width: 4 // 63 // End: //
Note: See TracChangeset
for help on using the changeset viewer.