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

Comparing jsr166/src/test/loops/DequeBash.java (file contents):
Revision 1.13 by dl, Sat Oct 22 19:30:48 2016 UTC vs.
Revision 1.15 by jsr166, Sun Oct 23 02:21:56 2016 UTC

# Line 32 | Line 32 | public class DequeBash {
32      static int random(int bound) {
33          return (random() & 0x7fffffff) % bound;
34      }
35 <    
35 >
36      public static void main(String[] args) throws Exception {
37          Class<?> cls = Class.forName(args[0]);
38          long startTime = System.nanoTime();
39          for (int j = 0; j < 200; ++j) {
40              @SuppressWarnings("unchecked")
41 <            Deque<Integer> deque = (Deque<Integer>) cls.newInstance();
41 >            Deque<Integer> deque =
42 >                (Deque<Integer>) cls.getConstructor().newInstance();
43              nextTail =  0;
44              nextHead = -1;
45              mainTest(deque, (random() & ((1 << 20) - 1)));
# Line 48 | Line 49 | public class DequeBash {
49          long now = System.nanoTime();
50          long elapsedTimeMillis = (now - startTime) / (1000L * 1000L);
51          System.out.printf("\ntotal time %d ms\n", elapsedTimeMillis);
52 <        
52 >
53      }
54  
55      static void mainTest(Deque<Integer> deque, int n) throws Exception {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines