We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c4b4e7 commit 620703eCopy full SHA for 620703e
concurrent/Summing.java
@@ -7,13 +7,11 @@
7
import onjava.Timer;
8
9
public class Summing {
10
- static volatile long result;
11
static void timeTest(String id, long checkValue,
12
LongSupplier operation) {
13
System.out.print(id + ": ");
14
Timer timer = new Timer();
15
- // Prevent optimization:
16
- result = operation.getAsLong();
+ long result = operation.getAsLong();
17
if(result == checkValue)
18
System.out.println(timer.duration() + "ms");
19
else
0 commit comments