Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 44 for sleep (0.4 sec)

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

          this.everyMillis = everyMillis;
          this.interruptee = interruptee;
        }
    
        @Override
        public void run() {
          while (true) {
            try {
              Thread.sleep(everyMillis);
            } catch (InterruptedException e) {
              // ok. just stop sleeping.
            }
            if (shouldStop) {
              break;
            }
            interruptee.interrupt();
          }
        }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

            public String call() throws InterruptedException {
              MILLISECONDS.sleep(DELAY_MS);
              return GOOD_CALLABLE_RESULT;
            }
          };
      private static final Callable<String> BAD_CALLABLE =
          new Callable<String>() {
            @Override
            public String call() throws InterruptedException, SampleException {
              MILLISECONDS.sleep(DELAY_MS);
              throw new SampleException();
            }
          };
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.5K bytes
    - Viewed (0)
  3. guava-testlib/test/com/google/common/util/concurrent/testing/TestingExecutorsTest.java

              public void run() {
                taskDone = true;
              }
            };
        ScheduledFuture<?> future =
            TestingExecutors.noOpScheduledExecutor().schedule(task, 10, TimeUnit.MILLISECONDS);
        Thread.sleep(20);
        assertFalse(taskDone);
        assertFalse(future.isDone());
      }
    
      public void testNoOpScheduledExecutorShutdown() {
        ListeningScheduledExecutorService executor = TestingExecutors.noOpScheduledExecutor();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

        }
      }
    
      private static void assertAtLeastTimePassed(Stopwatch stopwatch, long expectedMillis) {
        long elapsedMillis = stopwatch.elapsed(MILLISECONDS);
        /*
         * The "+ 5" below is to permit, say, sleep(10) to sleep only 9 milliseconds. We see such
         * behavior sometimes when running these tests publicly as part of Guava. "+ 5" is probably more
         * generous than it needs to be.
         */
        assertTrue(
    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)
  5. guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java

          this.everyMillis = everyMillis;
          this.interruptee = interruptee;
        }
    
        @Override
        public void run() {
          while (true) {
            try {
              Thread.sleep(everyMillis);
            } catch (InterruptedException e) {
              // ok. just stop sleeping.
            }
            if (shouldStop) {
              break;
            }
            interruptee.interrupt();
          }
        }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (1)
  6. android/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

            public String call() throws InterruptedException {
              MILLISECONDS.sleep(DELAY_MS);
              return GOOD_CALLABLE_RESULT;
            }
          };
      private static final Callable<String> BAD_CALLABLE =
          new Callable<String>() {
            @Override
            public String call() throws InterruptedException, SampleException {
              MILLISECONDS.sleep(DELAY_MS);
              throw new SampleException();
            }
          };
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.5K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java

        assertEquals(1, service.numIterations.get());
        service.stopAsync();
        service.secondBarrier.await();
        service.awaitTerminated();
        // Sleep for a while just to ensure that our task wasn't called again.
        Thread.sleep(UNIT.toMillis(3 * DELAY));
        assertEquals(1, service.numIterations.get());
      }
    
      public void testCustomScheduler_deadlock() throws InterruptedException, BrokenBarrierException {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.5K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

        }
      }
    
      /**
       * Delays, via Thread.sleep, for the given millisecond delay, but if the sleep is shorter than
       * specified, may re-sleep or yield until time elapses.
       */
      static void delay(long millis) throws InterruptedException {
        long startTime = System.nanoTime();
        long ns = millis * 1000 * 1000;
        for (; ; ) {
          if (millis > 0L) Thread.sleep(millis);
          else // too short to sleep
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 37.7K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/base/SuppliersTest.java

        List<Integer> result = addSupplier.get();
        assertEquals(Integer.valueOf(0), result.get(0));
        assertEquals(Integer.valueOf(1), result.get(1));
      }
    
      @J2ktIncompatible
      @GwtIncompatible // Thread.sleep
      @SuppressWarnings("DoNotCall")
      public void testMemoizeWithExpiration_longTimeUnit() throws InterruptedException {
        CountingSupplier countingSupplier = new CountingSupplier();
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 18.1K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/base/SuppliersTest.java

        List<Integer> result = addSupplier.get();
        assertEquals(Integer.valueOf(0), result.get(0));
        assertEquals(Integer.valueOf(1), result.get(1));
      }
    
      @J2ktIncompatible
      @GwtIncompatible // Thread.sleep
      @SuppressWarnings("DoNotCall")
      public void testMemoizeWithExpiration_longTimeUnit() throws InterruptedException {
        CountingSupplier countingSupplier = new CountingSupplier();
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 18.1K bytes
    - Viewed (0)
Back to top