ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/MapLoops.java
(Generate patch)

Comparing jsr166/src/test/loops/MapLoops.java (file contents):
Revision 1.5 by jsr166, Mon Nov 2 23:42:46 2009 UTC vs.
Revision 1.9 by jsr166, Sat Dec 21 22:28:43 2013 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   import java.util.*;
# Line 112 | Line 112 | public class MapLoops {
112          barrier.await();
113          barrier.await();
114          long time = timer.getTime();
115 <        long tpo = time / (i * (long)nops);
115 >        long tpo = time / (i * (long) nops);
116          System.out.print(LoopHelpers.rightJustify(tpo) + " ns per op");
117 <        double secs = (double)(time) / 1000000000.0;
117 >        double secs = (double) time / 1000000000.0;
118          System.out.println("\t " + secs + "s run time");
119          map.clear();
120      }
# Line 127 | Line 127 | public class MapLoops {
127          int position;
128          int total;
129  
130 <        Runner(int id, Map<Integer,Integer> map, Integer[] key,  CyclicBarrier barrier) {
130 >        Runner(int id, Map<Integer,Integer> map, Integer[] key, CyclicBarrier barrier) {
131              this.map = map;
132              this.key = key;
133              this.barrier = barrier;
# Line 137 | Line 137 | public class MapLoops {
137          }
138  
139          int step() {
140 <            // random-walk around key positions,  bunching accesses
140 >            // random-walk around key positions, bunching accesses
141              int r = rng.next();
142              position += (r & 7) - 3;
143              while (position >= key.length) position -= key.length;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines