Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for stopwatch (0.31 sec)

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

        RateLimiter limiter = RateLimiter.create(2.0, 4000, MILLISECONDS, 3.0, stopwatch);
        for (int i = 0; i < 8; i++) {
          limiter.acquire(); // #1
        }
        stopwatch.sleepMillis(500); // #2: to repay for the last acquire
        stopwatch.sleepMillis(4000); // #3: becomes cold again
        for (int i = 0; i < 8; i++) {
          limiter.acquire(); // // #4
        }
        stopwatch.sleepMillis(500); // #5: to repay for the last acquire
    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)
  2. guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        RateLimiter limiter = RateLimiter.create(2.0, 4000, MILLISECONDS, 3.0, stopwatch);
        for (int i = 0; i < 8; i++) {
          limiter.acquire(); // #1
        }
        stopwatch.sleepMillis(500); // #2: to repay for the last acquire
        stopwatch.sleepMillis(4000); // #3: becomes cold again
        for (int i = 0; i < 8; i++) {
          limiter.acquire(); // // #4
        }
        stopwatch.sleepMillis(500); // #5: to repay for the last acquire
    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)
  3. guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

        Stopwatch stopwatch = Stopwatch.createStarted();
        Condition condition = TestCondition.createAndSignalAfter(500, MILLISECONDS);
    
        boolean signaledBeforeTimeout = awaitUninterruptibly(condition, 1500, MILLISECONDS);
    
        assertTrue(signaledBeforeTimeout);
        assertTimeNotPassed(stopwatch, LONG_DELAY_MS);
        assertNotInterrupted();
      }
    
      public void testConditionAwaitInterruptedTimeoutExceeded() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 31.7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/util/concurrent/RateLimiter.java

        public static SleepingStopwatch createFromSystemTimer() {
          return new SleepingStopwatch() {
            final Stopwatch stopwatch = Stopwatch.createStarted();
    
            @Override
            protected long readMicros() {
              return stopwatch.elapsed(MICROSECONDS);
            }
    
            @Override
            protected void sleepMicrosUninterruptibly(long micros) {
              if (micros > 0) {
    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)
  5. android/guava-tests/test/com/google/common/collect/QueuesTest.java

          // producing one, will ask for two
          Future<?> producerThread = threadPool.submit(producer);
          producer.beganProducing.await();
    
          // make sure we time out
          Stopwatch timer = Stopwatch.createStarted();
    
          int drained = drain(q, newArrayList(), 2, 10, MILLISECONDS, interruptibly);
          assertThat(drained).isAtMost(1);
    
          assertThat(timer.elapsed(MILLISECONDS)).isAtLeast(10L);
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

        Stopwatch stopwatch = Stopwatch.createStarted();
        Condition condition = TestCondition.createAndSignalAfter(500, MILLISECONDS);
    
        boolean signaledBeforeTimeout = awaitUninterruptibly(condition, 1500, MILLISECONDS);
    
        assertTrue(signaledBeforeTimeout);
        assertTimeNotPassed(stopwatch, LONG_DELAY_MS);
        assertNotInterrupted();
      }
    
      public void testConditionAwaitInterruptedTimeoutExceeded() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 30.9K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/ServiceManager.java

                to);
            // Update the timer
            Stopwatch stopwatch = startupTimers.get(service);
            if (stopwatch == null) {
              // This means the service was started by some means other than ServiceManager.startAsync
              stopwatch = Stopwatch.createStarted();
              startupTimers.put(service, stopwatch);
            }
            if (to.compareTo(RUNNING) >= 0 && stopwatch.isRunning()) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Dec 13 19:45:20 GMT 2023
    - 30.5K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java

        Constructor<?> sepFwrCons = sepFwrC.getConstructor(Object.class, sepFrqC);
        // The object that we will wrap in FinalizableWeakReference is a Stopwatch.
        Class<?> sepStopwatchC = sepLoader.loadClass(Stopwatch.class.getName());
        assertSame(sepLoader, sepStopwatchC.getClassLoader());
        AtomicReference<Object> sepStopwatchA =
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 16 03:24:50 GMT 2021
    - 13.3K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/hash/BloomFilterTest.java

          bloomFilter.put(getNonGoldenRandomKey());
        }
        bloomFilter.put(GOLDEN_PRESENT_KEY);
    
        int numThreads = 12;
        final double safetyFalsePositiveRate = 0.1;
        final Stopwatch stopwatch = Stopwatch.createStarted();
    
        Runnable task =
            new Runnable() {
              @Override
              public void run() {
                do {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/collect/QueuesTest.java

          // producing one, will ask for two
          Future<?> producerThread = threadPool.submit(producer);
          producer.beganProducing.await();
    
          // make sure we time out
          Stopwatch timer = Stopwatch.createStarted();
    
          int drained = drain(q, newArrayList(), 2, 10, MILLISECONDS, interruptibly);
          assertThat(drained).isAtMost(1);
    
          assertThat(timer.elapsed(MILLISECONDS)).isAtLeast(10L);
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12K bytes
    - Viewed (0)
Back to top