Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 45 for toNanos (0.06 seconds)

  1. 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)
  2. 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)
  3. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/ws/RealWebSocket.kt

              minimumDeflateSize = minimumDeflateSize,
            )
          this.writerTask = WriterTask()
          if (pingIntervalMillis != 0L) {
            val pingIntervalNanos = MILLISECONDS.toNanos(pingIntervalMillis)
            taskQueue.schedule("$name ping", pingIntervalNanos) {
              writePingFrame()
              return@schedule pingIntervalNanos
            }
          }
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Thu Jul 31 04:18:40 GMT 2025
    - 21.6K bytes
    - Click Count (0)
  4. 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)
  5. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/-UtilJvm.kt

        if (timeout().hasDeadline()) {
          timeout().deadlineNanoTime() - nowNs
        } else {
          Long.MAX_VALUE
        }
      timeout().deadlineNanoTime(nowNs + minOf(originalDurationNs, timeUnit.toNanos(duration.toLong())))
      return try {
        val skipBuffer = Buffer()
        while (read(skipBuffer, 8192) != -1L) {
          skipBuffer.clear()
        }
        true // Success! The source has been exhausted.
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 10.3K bytes
    - Click Count (1)
  6. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/RealConnectionPool.kt

      private val maxIdleConnections: Int,
      keepAliveDuration: Long,
      timeUnit: TimeUnit,
      internal val connectionListener: ConnectionListener,
    ) {
      internal val keepAliveDurationNs: Long = timeUnit.toNanos(keepAliveDuration)
    
      private val cleanupQueue: TaskQueue = taskRunner.newQueue()
      private val cleanupTask =
        object : Task("$okHttpName ConnectionPool connection closer") {
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 11.1K bytes
    - Click Count (0)
  7. 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)
  8. 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
    - 51.7K bytes
    - Click Count (0)
  9. 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)
  10. 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)
Back to Top