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

Comparing jsr166/src/test/loops/LoopHelpers.java (file contents):
Revision 1.4 by dl, Sun Aug 7 19:25:55 2005 UTC vs.
Revision 1.5 by dl, Thu Sep 15 16:55:40 2005 UTC

# Line 168 | Line 168 | class LoopHelpers {
168      }
169  
170      public static class BarrierTimer implements Runnable {
171 <        public volatile long startTime;
172 <        public volatile long endTime;
171 >        volatile boolean started;
172 >        volatile long startTime;
173 >        volatile long endTime;
174          public void run() {
175              long t = System.nanoTime();
176 <            if (startTime == 0)
176 >            if (!started) {
177 >                started = true;
178                  startTime = t;
179 <            else
179 >            } else
180                  endTime = t;
181          }
182          public void clear() {
183 <            startTime = 0;
182 <            endTime = 0;
183 >            started = false;
184          }
185          public long getTime() {
186              return endTime - startTime;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines