Search Options

Display Count
Sort
Preferred Language
Advanced Search

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

  1. android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java

      public static boolean awaitUninterruptibly(CountDownLatch latch, long timeout, TimeUnit unit) {
        boolean interrupted = false;
        try {
          long remainingNanos = unit.toNanos(timeout);
          long end = System.nanoTime() + remainingNanos;
    
          while (true) {
            try {
              // CountDownLatch treats negative timeouts just like zero.
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Jan 29 23:24:32 GMT 2026
    - 22.5K bytes
    - Click Count (0)
  2. 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)
  3. 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)
  4. 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)
  5. android/guava/src/com/google/common/util/concurrent/ListenableFutureTask.java

      }
    
      @CanIgnoreReturnValue
      @Override
      @ParametricNullness
      public V get(long timeout, TimeUnit unit)
          throws TimeoutException, InterruptedException, ExecutionException {
    
        long timeoutNanos = unit.toNanos(timeout);
        if (timeoutNanos <= OverflowAvoidingLockSupport.MAX_NANOSECONDS_THRESHOLD) {
          return super.get(timeout, unit);
        }
        // Waiting 68 years should be enough for any program.
        return super.get(
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Feb 10 11:51:21 GMT 2026
    - 4.2K bytes
    - Click Count (0)
  6. android/guava/src/com/google/common/cache/CacheBuilder.java

            "expireAfterWrite was already set to %s ns",
            expireAfterWriteNanos);
        checkArgument(duration >= 0, "duration cannot be negative: %s %s", duration, unit);
        this.expireAfterWriteNanos = unit.toNanos(duration);
        return this;
      }
    
      @SuppressWarnings("GoodTime") // nanos internally, should be Duration
      long getExpireAfterWriteNanos() {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Feb 23 13:13:59 GMT 2026
    - 52K bytes
    - Click Count (0)
  7. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/FastFallbackExchangeFinder.kt

     */
    internal class FastFallbackExchangeFinder(
      override val routePlanner: RoutePlanner,
      private val taskRunner: TaskRunner,
    ) : ExchangeFinder {
      private val connectDelayNanos = TimeUnit.MILLISECONDS.toNanos(250L)
      private var nextTcpConnectAtNanos = Long.MIN_VALUE
    
      /**
       * Plans currently being connected, and that will later be added to [connectResults]. This is
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 5.8K bytes
    - Click Count (0)
  8. guava/src/com/google/common/collect/Queues.java

         * execute Queue#drainTo is not added *on top* of waiting for the timeout (which could make
         * the timeout arbitrarily inaccurate, given a queue that is slow to drain).
         */
        long deadline = System.nanoTime() + unit.toNanos(timeout);
        int added = 0;
        while (added < numElements) {
          // we could rely solely on #poll, but #drainTo might be more efficient when there are multiple
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Feb 23 19:19:10 GMT 2026
    - 18K bytes
    - Click Count (0)
  9. 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)
  10. android/guava/src/com/google/common/collect/Queues.java

         * execute Queue#drainTo is not added *on top* of waiting for the timeout (which could make
         * the timeout arbitrarily inaccurate, given a queue that is slow to drain).
         */
        long deadline = System.nanoTime() + unit.toNanos(timeout);
        int added = 0;
        while (added < numElements) {
          // we could rely solely on #poll, but #drainTo might be more efficient when there are multiple
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Feb 23 19:19:10 GMT 2026
    - 18.2K bytes
    - Click Count (0)
Back to Top