Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit e7ce807

Browse files
committed
NegativeCompensation test should run faster
1 parent b860516 commit e7ce807

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/org/openjdk/other/tests/sumAndAverage/NegativeCompensation.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
public class NegativeCompensation {
3737
static final double VAL = 1.000000001;
38-
static final int LOG_ITER = 21;
38+
static final int LOG_ITER = 20;
3939

4040
@Test
4141
public static void test() {
@@ -58,10 +58,14 @@ public static void main(String[] args) {
5858
stat2.combine(stat1);
5959
}
6060

61-
System.out.println("count: " + stat2.getCount());
62-
for (long i = 0, iend = stat2.getCount(); i < iend; ++i) {
61+
final long iend = stat2.getCount();
62+
System.out.println("NegativeCompensation count: " + iend);
63+
long start = System.currentTimeMillis();
64+
65+
for (long i = 0L; i < iend; ++i) {
6366
stat0.accept(VAL);
6467
}
68+
System.out.println("NegativeCompensation took: " + (System.currentTimeMillis() - start) + " ms");
6569

6670
double absErr = Math.abs(stat0.getSum() - stat2.getSum());
6771
System.out.println("serial sum: " + stat0.getSum());

0 commit comments

Comments
 (0)