Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 99 for Counter (0.37 sec)

  1. guava-tests/test/com/google/common/cache/AbstractCacheTest.java

      public void testSingleSimpleStats() {
        StatsCounter counter = new SimpleStatsCounter();
        for (int i = 0; i < 11; i++) {
          counter.recordHits(1);
        }
        for (int i = 0; i < 13; i++) {
          counter.recordLoadSuccess(i);
        }
        for (int i = 0; i < 17; i++) {
          counter.recordLoadException(i);
        }
        for (int i = 0; i < 23; i++) {
          counter.recordMisses(1);
        }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 6.2K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java

          void doIt(ImmutableLongArray.Builder builder, AtomicLong counter) {
            builder.add(counter.getAndIncrement());
          }
        },
        ADD_ARRAY {
          @Override
          void doIt(ImmutableLongArray.Builder builder, AtomicLong counter) {
            long[] array = new long[RANDOM.nextInt(10)];
            for (int i = 0; i < array.length; i++) {
              array[i] = counter.getAndIncrement();
            }
            builder.addAll(array);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Jun 01 09:32:35 GMT 2023
    - 20.2K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java

          void doIt(ImmutableDoubleArray.Builder builder, AtomicInteger counter) {
            builder.add(counter.getAndIncrement());
          }
        },
        ADD_ARRAY {
          @Override
          void doIt(ImmutableDoubleArray.Builder builder, AtomicInteger counter) {
            double[] array = new double[RANDOM.nextInt(10)];
            for (int i = 0; i < array.length; i++) {
              array[i] = counter.getAndIncrement();
            }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Jun 06 15:23:21 GMT 2023
    - 20K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java

      /**
       * Multiple threads using same array of counters successfully update a number of times equal to
       * total count
       */
      public void testCountingInMultipleThreads() throws InterruptedException {
        final AtomicDoubleArray aa = new AtomicDoubleArray(SIZE);
        for (int i = 0; i < SIZE; i++) {
          aa.set(i, (double) COUNTDOWN);
        }
        Counter c1 = new Counter(aa);
        Counter c2 = new Counter(aa);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 10K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/cache/AbstractCacheTest.java

      public void testSingleSimpleStats() {
        StatsCounter counter = new SimpleStatsCounter();
        for (int i = 0; i < 11; i++) {
          counter.recordHits(1);
        }
        for (int i = 0; i < 13; i++) {
          counter.recordLoadSuccess(i);
        }
        for (int i = 0; i < 17; i++) {
          counter.recordLoadException(i);
        }
        for (int i = 0; i < 23; i++) {
          counter.recordMisses(1);
        }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 6.2K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/io/CountingInputStreamTest.java

        assertEquals(-1, counter.read(new byte[30]));
        assertEquals(20, counter.getCount());
      }
    
      @SuppressWarnings("CheckReturnValue") // calling read() to skip a byte
      public void testMark() throws Exception {
        assertTrue(counter.markSupported());
        assertEquals(10, counter.read(new byte[10]));
        assertEquals(10, counter.getCount());
        counter.mark(5);
        counter.read();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/CountingInputStreamTest.java

        assertEquals(-1, counter.read(new byte[30]));
        assertEquals(20, counter.getCount());
      }
    
      @SuppressWarnings("CheckReturnValue") // calling read() to skip a byte
      public void testMark() throws Exception {
        assertTrue(counter.markSupported());
        assertEquals(10, counter.read(new byte[10]));
        assertEquals(10, counter.getCount());
        counter.mark(5);
        counter.read();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java

      /**
       * Multiple threads using same array of counters successfully update a number of times equal to
       * total count
       */
      public void testCountingInMultipleThreads() throws InterruptedException {
        final AtomicDoubleArray aa = new AtomicDoubleArray(SIZE);
        for (int i = 0; i < SIZE; i++) {
          aa.set(i, (double) COUNTDOWN);
        }
        Counter c1 = new Counter(aa);
        Counter c2 = new Counter(aa);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 14.5K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/collect/AbstractHashFloodingTest.java

                    strs ->
                        new CountsHashCodeAndEquals(
                            String.join("", strs),
                            () -> counter.hashCode++,
                            () -> counter.equals++,
                            () -> counter.compareTo++)));
        assertEquals(
            result.get(0).delegateString.hashCode(),
            result.get(result.size() - 1).delegateString.hashCode());
        return result;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 03 21:01:39 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/util/concurrent/TrustedListenableFutureTaskTest.java

        for (int i = 0; i < 1000; i++) {
          final AtomicInteger counter = new AtomicInteger();
          final TrustedListenableFutureTask<Integer> task =
              TrustedListenableFutureTask.create(
                  new Callable<Integer>() {
                    @Override
                    public Integer call() {
                      return counter.incrementAndGet();
                    }
                  });
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 7.3K bytes
    - Viewed (0)
Back to top