Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 514 for seconds (0.23 sec)

  1. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

          }
        }
      }
    
      /* Half of a 1-second timeout in nanoseconds */
      private static final long HALF_SECOND_NANOS = NANOSECONDS.convert(1L, SECONDS) / 2;
    
      public void testShutdownAndAwaitTermination_immediateShutdown() throws Exception {
        ExecutorService service = Executors.newSingleThreadExecutor();
        assertTrue(shutdownAndAwaitTermination(service, 1L, SECONDS));
        assertTrue(service.isTerminated());
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (3)
  2. android/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

          }
        }
      }
    
      /* Half of a 1-second timeout in nanoseconds */
      private static final long HALF_SECOND_NANOS = NANOSECONDS.convert(1L, SECONDS) / 2;
    
      public void testShutdownAndAwaitTermination_immediateShutdown() throws Exception {
        ExecutorService service = Executors.newSingleThreadExecutor();
        assertTrue(shutdownAndAwaitTermination(service, 1L, SECONDS));
        assertTrue(service.isTerminated());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java

            "foo", getChecked(immediateFuture("foo"), TwoArgConstructorException.class, 0, SECONDS));
      }
    
      public void testGetCheckedTimed_interrupted() {
        SettableFuture<String> future = SettableFuture.create();
        Thread.currentThread().interrupt();
        try {
          getChecked(future, TwoArgConstructorException.class, 0, SECONDS);
          fail();
        } catch (TwoArgConstructorException expected) {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.4K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        assertTrue(limiter.tryAcquire(0, SECONDS));
        assertFalse(limiter.tryAcquire(0, SECONDS));
        assertFalse(limiter.tryAcquire(0, SECONDS));
        stopwatch.sleepMillis(100);
        assertFalse(limiter.tryAcquire(0, SECONDS));
      }
    
      public void testTryAcquire_someWaitAllowed() {
        RateLimiter limiter = RateLimiter.create(5.0, stopwatch);
        assertTrue(limiter.tryAcquire(0, SECONDS));
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.6K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/RateLimiter.java

       * second" (commonly referred to as <i>QPS</i>, queries per second).
       *
       * <p>The returned {@code RateLimiter} ensures that on average no more than {@code
       * permitsPerSecond} are issued during any given second, with sustained requests being smoothly
       * spread over each second. When the incoming request rate exceeds {@code permitsPerSecond} the
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 18.2K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        assertTrue(limiter.tryAcquire(0, SECONDS));
        assertFalse(limiter.tryAcquire(0, SECONDS));
        assertFalse(limiter.tryAcquire(0, SECONDS));
        stopwatch.sleepMillis(100);
        assertFalse(limiter.tryAcquire(0, SECONDS));
      }
    
      public void testTryAcquire_someWaitAllowed() {
        RateLimiter limiter = RateLimiter.create(5.0, stopwatch);
        assertTrue(limiter.tryAcquire(0, SECONDS));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.6K bytes
    - Viewed (0)
  7. guava-testlib/src/com/google/common/testing/GcFinalization.java

          return;
        }
        long timeoutSeconds = timeoutSeconds();
        long deadline = System.nanoTime() + SECONDS.toNanos(timeoutSeconds);
        do {
          System.runFinalization();
          if (future.isDone()) {
            return;
          }
          System.gc();
          try {
            future.get(1L, SECONDS);
            return;
          } catch (CancellationException | ExecutionException ok) {
            return;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java

            "foo", getChecked(immediateFuture("foo"), TwoArgConstructorException.class, 0, SECONDS));
      }
    
      public void testGetCheckedTimed_interrupted() {
        SettableFuture<String> future = SettableFuture.create();
        Thread.currentThread().interrupt();
        try {
          getChecked(future, TwoArgConstructorException.class, 0, SECONDS);
          fail();
        } catch (TwoArgConstructorException expected) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.4K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java

       *
       * How this works is best explained with an example:
       *
       * For a RateLimiter that produces 1 token per second, every second that goes by with the
       * RateLimiter being unused, we increase storedPermits by 1. Say we leave the RateLimiter unused
       * for 10 seconds (i.e., we expected a request at time X, but we are at time X + 10 seconds before
       * a request actually arrives; this is also related to the point made in the last paragraph), thus
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 19.3K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/cache/CacheBuilderTest.java

            CacheBuilder.newBuilder().refreshAfterWrite(3600, SECONDS);
        assertThrows(IllegalStateException.class, () -> builder.refreshAfterWrite(3600, SECONDS));
      }
    
      @GwtIncompatible // java.time.Duration
      public void testRefresh_setTwice_duration() {
        CacheBuilder<Object, Object> builder =
            CacheBuilder.newBuilder().refreshAfterWrite(java.time.Duration.ofSeconds(3600));
        assertThrows(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 03 20:10:02 GMT 2023
    - 25.5K bytes
    - Viewed (0)
Back to top