91 |
|
return y; |
92 |
|
} |
93 |
|
|
94 |
+ |
// FNV: (x ^ 0x811c9dc5) * 0x01000193; 15485863; |
95 |
|
|
96 |
|
/** |
97 |
|
* Marsaglia xorshift for longs |
169 |
|
} |
170 |
|
|
171 |
|
public static class BarrierTimer implements Runnable { |
172 |
< |
public volatile long startTime; |
173 |
< |
public volatile long endTime; |
172 |
> |
volatile boolean started; |
173 |
> |
volatile long startTime; |
174 |
> |
volatile long endTime; |
175 |
|
public void run() { |
176 |
|
long t = System.nanoTime(); |
177 |
< |
if (startTime == 0) |
177 |
> |
if (!started) { |
178 |
> |
started = true; |
179 |
|
startTime = t; |
180 |
< |
else |
180 |
> |
} else |
181 |
|
endTime = t; |
182 |
|
} |
183 |
|
public void clear() { |
184 |
< |
startTime = 0; |
182 |
< |
endTime = 0; |
184 |
> |
started = false; |
185 |
|
} |
186 |
|
public long getTime() { |
187 |
|
return endTime - startTime; |