Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 31 - 40 of 45 for toNanos (0.09 seconds)

  1. 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)
  2. 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)
  3. 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)
  4. okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt

        assertFailsWith<SocketTimeoutException> {
          call.execute()
        }
        val elapsedNanos = System.nanoTime() - startNanos
        org.junit.jupiter.api.Assertions.assertTrue(
          elapsedNanos < TimeUnit.SECONDS.toNanos(5),
          "Timeout should have taken ~100ms but was " + elapsedNanos / 1e6 + " ms",
        )
      }
    
      @Test
      fun chainWithReadTimeout() {
        val interceptor1 =
          Interceptor { chainA: Interceptor.Chain ->
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Nov 04 16:11:23 GMT 2025
    - 28.2K bytes
    - Click Count (0)
  5. android/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/src/com/google/common/cache/CacheBuilderSpec.java

       * nanos to match CacheBuilder implementation.
       */
      private static @Nullable Long durationInNanos(long duration, @Nullable TimeUnit unit) {
        return (unit == null) ? null : unit.toNanos(duration);
      }
    
      /** Base class for parsing integers. */
      private abstract static class IntegerParser implements ValueParser {
        abstract void parseInteger(CacheBuilderSpec spec, int value);
    
        @Override
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Apr 01 17:27:13 GMT 2026
    - 18.2K bytes
    - Click Count (0)
  7. guava/src/com/google/common/cache/CacheBuilderSpec.java

       * nanos to match CacheBuilder implementation.
       */
      private static @Nullable Long durationInNanos(long duration, @Nullable TimeUnit unit) {
        return (unit == null) ? null : unit.toNanos(duration);
      }
    
      /** Base class for parsing integers. */
      private abstract static class IntegerParser implements ValueParser {
        abstract void parseInteger(CacheBuilderSpec spec, int value);
    
        @Override
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Apr 01 17:27:13 GMT 2026
    - 18.2K bytes
    - Click Count (0)
  8. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http2/Http2Connection.kt

      // Guarded by this.
      private val currentPushRequests = mutableSetOf<Int>()
    
      init {
        if (builder.pingIntervalMillis != 0) {
          val pingIntervalNanos = TimeUnit.MILLISECONDS.toNanos(builder.pingIntervalMillis.toLong())
          writerQueue.schedule("$connectionName ping", pingIntervalNanos) {
            val failDueToMissingPong =
              withLock {
                if (intervalPongsReceived < intervalPingsSent) {
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 31.9K bytes
    - Click Count (0)
  9. android/guava/src/com/google/common/util/concurrent/MoreExecutors.java

        checkArgument(ntasks > 0);
        List<Future<T>> futures = Lists.newArrayListWithCapacity(ntasks);
        BlockingQueue<Future<T>> futureQueue = Queues.newLinkedBlockingQueue();
        long timeoutNanos = unit.toNanos(timeout);
    
        // For efficiency, especially in executors with limited
        // parallelism, check to see if previously submitted tasks are
        // done before submitting more of them. This interleaving
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Jan 28 22:39:02 GMT 2026
    - 45.6K bytes
    - Click Count (0)
  10. android/guava/src/com/google/common/util/concurrent/Monitor.java

        }
      }
    
      /**
       * Returns unit.toNanos(time), additionally ensuring the returned value is not at risk of
       * overflowing or underflowing, by bounding the value between 0 and (Long.MAX_VALUE / 4) * 3.
       * Actually waiting for more than 219 years is not supported!
       */
      private static long toSafeNanos(long time, TimeUnit unit) {
        long timeoutNanos = unit.toNanos(time);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Jan 28 22:39:02 GMT 2026
    - 43.5K bytes
    - Click Count (0)
Back to Top