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 |
|
} |