1 |
+ |
/* |
2 |
+ |
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
+ |
* Expert Group and released to the public domain, as explained at |
4 |
+ |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
+ |
*/ |
6 |
|
import java.util.concurrent.*; |
7 |
|
import java.util.Random; |
8 |
|
|
42 |
|
long sum = 0; |
43 |
|
int x = rng.next(); |
44 |
|
for (int i = 0; i < 1000000; ++i) { |
45 |
< |
long l = (long)x + (long)x; |
45 |
> |
long l = (long) x + (long) x; |
46 |
|
sum += cvt(l, TimeUnit.SECONDS); |
47 |
|
sum += TimeUnit.MILLISECONDS.toMicros(l+2); |
48 |
|
sum += cvt(l+17, TimeUnit.NANOSECONDS); |