Java Code Examples for java.util.concurrent.atomic.LongAdder#reset()
The following examples show how to use
java.util.concurrent.atomic.LongAdder#reset() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RandomTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * A sequential sized stream of ints generates the given number of values */ public void testIntsCount() { LongAdder counter = new LongAdder(); Random r = new Random(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.ints(size).forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }
Example 2
Source File: RandomTest.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * A sequential sized stream of longs generates the given number of values */ public void testLongsCount() { LongAdder counter = new LongAdder(); Random r = new Random(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.longs(size).forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }
Example 3
Source File: SplittableRandomTest.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of ints generates the given number of values */ public void testIntsCount() { LongAdder counter = new LongAdder(); SplittableRandom r = new SplittableRandom(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.ints(size).parallel().forEach(x -> {counter.increment();}); assertEquals(counter.sum(), size); size += 524959; } }
Example 4
Source File: ThreadLocalRandomTest.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of doubles generates the given number of values */ public void testDoublesCount() { LongAdder counter = new LongAdder(); ThreadLocalRandom r = ThreadLocalRandom.current(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.doubles(size).parallel().forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }
Example 5
Source File: SplittableRandomTest.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of doubles generates the given number of values */ public void testDoublesCount() { LongAdder counter = new LongAdder(); SplittableRandom r = new SplittableRandom(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.doubles(size).parallel().forEach(x -> {counter.increment();}); assertEquals(counter.sum(), size); size += 524959; } }
Example 6
Source File: SplittableRandomTest.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of ints generates the given number of values */ public void testIntsCount() { LongAdder counter = new LongAdder(); SplittableRandom r = new SplittableRandom(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.ints(size).parallel().forEach(x -> {counter.increment();}); assertEquals(counter.sum(), size); size += 524959; } }
Example 7
Source File: SplittableRandomTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of ints generates the given number of values */ public void testIntsCount() { LongAdder counter = new LongAdder(); SplittableRandom r = new SplittableRandom(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.ints(size).parallel().forEach(x -> counter.increment()); assertEquals(size, counter.sum()); size += 524959; } }
Example 8
Source File: SplittableRandomTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of longs generates the given number of values */ public void testLongsCount() { LongAdder counter = new LongAdder(); SplittableRandom r = new SplittableRandom(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.longs(size).parallel().forEach(x -> {counter.increment();}); assertEquals(counter.sum(), size); size += 524959; } }
Example 9
Source File: ThreadLocalRandomTest.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of ints generates the given number of values */ public void testIntsCount() { LongAdder counter = new LongAdder(); ThreadLocalRandom r = ThreadLocalRandom.current(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.ints(size).parallel().forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }
Example 10
Source File: ThreadLocalRandomTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of ints generates the given number of values */ public void testIntsCount() { LongAdder counter = new LongAdder(); ThreadLocalRandom r = ThreadLocalRandom.current(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.ints(size).parallel().forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }
Example 11
Source File: ThreadLocalRandom8Test.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of doubles generates the given number of values */ public void testDoublesCount() { LongAdder counter = new LongAdder(); ThreadLocalRandom r = ThreadLocalRandom.current(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.doubles(size).parallel().forEach(x -> counter.increment()); assertEquals(size, counter.sum()); size += 524959; } }
Example 12
Source File: RandomTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * A sequential sized stream of longs generates the given number of values */ public void testLongsCount() { LongAdder counter = new LongAdder(); Random r = new Random(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.longs(size).forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }
Example 13
Source File: ThreadLocalRandomTest.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of doubles generates the given number of values */ public void testDoublesCount() { LongAdder counter = new LongAdder(); ThreadLocalRandom r = ThreadLocalRandom.current(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.doubles(size).parallel().forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }
Example 14
Source File: SplittableRandomTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of longs generates the given number of values */ public void testLongsCount() { LongAdder counter = new LongAdder(); SplittableRandom r = new SplittableRandom(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.longs(size).parallel().forEach(x -> {counter.increment();}); assertEquals(counter.sum(), size); size += 524959; } }
Example 15
Source File: ThreadLocalRandomTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of longs generates the given number of values */ public void testLongsCount() { LongAdder counter = new LongAdder(); ThreadLocalRandom r = ThreadLocalRandom.current(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.longs(size).parallel().forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }
Example 16
Source File: SplittableRandomTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of doubles generates the given number of values */ public void testDoublesCount() { LongAdder counter = new LongAdder(); SplittableRandom r = new SplittableRandom(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.doubles(size).parallel().forEach(x -> {counter.increment();}); assertEquals(counter.sum(), size); size += 524959; } }
Example 17
Source File: ThreadLocalRandom8Test.java From j2objc with Apache License 2.0 | 5 votes |
/** * A parallel sized stream of longs generates the given number of values */ public void testLongsCount() { LongAdder counter = new LongAdder(); ThreadLocalRandom r = ThreadLocalRandom.current(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.longs(size).parallel().forEach(x -> counter.increment()); assertEquals(size, counter.sum()); size += 524959; } }
Example 18
Source File: RandomTest.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * A sequential sized stream of longs generates the given number of values */ public void testLongsCount() { LongAdder counter = new LongAdder(); Random r = new Random(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.longs(size).forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }
Example 19
Source File: SplittableRandomTest.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * A parallel sized stream of longs generates the given number of values */ public void testLongsCount() { LongAdder counter = new LongAdder(); SplittableRandom r = new SplittableRandom(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.longs(size).parallel().forEach(x -> {counter.increment();}); assertEquals(counter.sum(), size); size += 524959; } }
Example 20
Source File: RandomTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * A sequential sized stream of doubles generates the given number of values */ public void testDoublesCount() { LongAdder counter = new LongAdder(); Random r = new Random(); long size = 0; for (int reps = 0; reps < REPS; ++reps) { counter.reset(); r.doubles(size).forEach(x -> { counter.increment(); }); assertEquals(counter.sum(), size); size += 524959; } }