Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 15 for toNanos (0.07 seconds)

  1. android/guava-testlib/src/com/google/common/testing/GcFinalization.java

      public static void awaitDone(Future<?> future) {
        if (future.isDone()) {
          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;
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Mar 12 20:19:19 GMT 2026
    - 12.3K bytes
    - Click Count (0)
  2. guava-testlib/src/com/google/common/testing/GcFinalization.java

      public static void awaitDone(Future<?> future) {
        if (future.isDone()) {
          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;
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Mar 12 20:19:19 GMT 2026
    - 12.3K bytes
    - Click Count (0)
  3. android/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java

        }
    
        @Override
        public boolean equals(@Nullable Object o) {
          if (o instanceof DurationSpec) {
            DurationSpec that = (DurationSpec) o;
            return unit.toNanos(duration) == that.unit.toNanos(that.duration);
          }
          return false;
        }
    
        @Override
        public String toString() {
          return MoreObjects.toStringHelper(this)
              .add("duration", duration)
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 7.5K bytes
    - Click Count (0)
  4. guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java

         */
        @CanIgnoreReturnValue
        @Override
        public V get(long timeout, TimeUnit unit)
            throws InterruptedException, TimeoutException, ExecutionException {
          return sync.get(unit.toNanos(timeout));
        }
    
        /*
         * Improve the documentation of when InterruptedException is thrown. Our
         * behavior matches the JDK's, but the JDK's documentation is misleading.
         */
        /**
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sat Mar 07 02:20:33 GMT 2026
    - 13.8K bytes
    - Click Count (0)
  5. guava/src/com/google/common/base/Suppliers.java

          Supplier<T> delegate, long duration, TimeUnit unit) {
        checkNotNull(delegate);
        checkArgument(duration > 0, "duration (%s %s) must be > 0", duration, unit);
        return new ExpiringMemoizingSupplier<>(delegate, unit.toNanos(duration));
      }
    
      /**
       * Returns a supplier that caches the instance supplied by the delegate and removes the cached
       * value after the specified time has passed. Subsequent calls to {@code get()} return the cached
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Mar 31 21:24:28 GMT 2026
    - 16.1K bytes
    - Click Count (0)
  6. android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java

         */
        @CanIgnoreReturnValue
        @Override
        public V get(long timeout, TimeUnit unit)
            throws InterruptedException, TimeoutException, ExecutionException {
          return sync.get(unit.toNanos(timeout));
        }
    
        /*
         * Improve the documentation of when InterruptedException is thrown. Our
         * behavior matches the JDK's, but the JDK's documentation is misleading.
         */
        /**
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sat Mar 07 02:20:33 GMT 2026
    - 13.8K bytes
    - Click Count (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        }
    
        void sleepMillis(int millis) {
          sleepMicros("U", MILLISECONDS.toMicros(millis));
        }
    
        void sleepMicros(String caption, long micros) {
          instant += MICROSECONDS.toNanos(micros);
          events.add(caption + String.format(Locale.ROOT, "%3.2f", micros / 1000000.0));
        }
    
        @Override
        protected void sleepMicrosUninterruptibly(long micros) {
          sleepMicros("R", micros);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Mar 12 17:47:10 GMT 2026
    - 22K bytes
    - Click Count (0)
  8. guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        }
    
        void sleepMillis(int millis) {
          sleepMicros("U", MILLISECONDS.toMicros(millis));
        }
    
        void sleepMicros(String caption, long micros) {
          instant += MICROSECONDS.toNanos(micros);
          events.add(caption + String.format(Locale.ROOT, "%3.2f", micros / 1000000.0));
        }
    
        @Override
        protected void sleepMicrosUninterruptibly(long micros) {
          sleepMicros("R", micros);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Mar 12 17:47:10 GMT 2026
    - 22K bytes
    - Click Count (0)
  9. android/guava-tests/test/com/google/common/cache/LocalCacheTest.java

        assertThat(map.expireAfterWriteNanos).isEqualTo(unit.toNanos(duration));
      }
    
      public void testSetExpireAfterAccess() {
        long duration = 42;
        TimeUnit unit = SECONDS;
        LocalCache<Object, Object> map =
            makeLocalCache(createCacheBuilder().expireAfterAccess(duration, unit));
        assertThat(map.expireAfterAccessNanos).isEqualTo(unit.toNanos(duration));
      }
    
      public void testSetRefresh() {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 114.9K bytes
    - Click Count (0)
  10. guava-tests/test/com/google/common/cache/LocalCacheTest.java

        assertThat(map.expireAfterWriteNanos).isEqualTo(unit.toNanos(duration));
      }
    
      public void testSetExpireAfterAccess() {
        long duration = 42;
        TimeUnit unit = SECONDS;
        LocalCache<Object, Object> map =
            makeLocalCache(createCacheBuilder().expireAfterAccess(duration, unit));
        assertThat(map.expireAfterAccessNanos).isEqualTo(unit.toNanos(duration));
      }
    
      public void testSetRefresh() {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 116.4K bytes
    - Click Count (0)
Back to Top