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

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.144 by jsr166, Mon Sep 14 03:14:01 2015 UTC vs.
Revision 1.145 by jsr166, Fri Sep 25 05:41:29 2015 UTC

# Line 198 | Line 198 | public class JSR166TestCase extends Test
198      }
199  
200      protected void runTestProfiled() throws Throwable {
201 <        // Warmup run, notably to trigger all needed classloading.
202 <        super.runTest();
203 <        long t0 = System.nanoTime();
204 <        try {
201 >        for (int i = 0; i < 2; i++) {
202 >            long startTime = System.nanoTime();
203              super.runTest();
204 <        } finally {
205 <            long elapsedMillis = millisElapsedSince(t0);
206 <            if (elapsedMillis >= profileThreshold)
204 >            long elapsedMillis = millisElapsedSince(startTime);
205 >            if (elapsedMillis < profileThreshold)
206 >                break;
207 >            // Never report first run of any test; treat it as a
208 >            // warmup run, notably to trigger all needed classloading,
209 >            if (i > 0)
210                  System.out.printf("%n%s: %d%n", toString(), elapsedMillis);
211          }
212      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines