Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 100 for nanoSeconds (0.11 sec)

  1. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

        val inputStream = connection.getInputStream()
        assertThat(inputStream.read()).isEqualTo(-1)
        val elapsedNanos = System.nanoTime() - startNanos
        val elapsedMillis = TimeUnit.NANOSECONDS.toMillis(elapsedNanos)
        assertThat(elapsedMillis).isBetween(500L, 1000L)
      }
    
      /**
       * Throttle the response body by sleeping 500ms after every 3 bytes. With a 6-byte response, this
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  2. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

        val inputStream = connection.getInputStream()
        assertThat(inputStream.read()).isEqualTo(-1)
        val elapsedNanos = System.nanoTime() - startNanos
        val elapsedMillis = TimeUnit.NANOSECONDS.toMillis(elapsedNanos)
        assertThat(elapsedMillis).isBetween(500L, 1000L)
      }
    
      /**
       * Throttle the response body by sleeping 500ms after every 3 bytes. With a 6-byte response, this
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 23.5K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/connection/FastFallbackExchangeFinder.kt

            }
    
            // Wait for an in-flight connect to complete or fail.
            if (connectResult == null) {
              connectResult = awaitTcpConnect(awaitTimeoutNanos, TimeUnit.NANOSECONDS) ?: continue
            }
    
            if (connectResult.isSuccess) {
              // We have a connected TCP connection. Cancel and defer the racing connects that all lost.
              cancelInFlightConnects()
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  4. okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt

        val startNs = startNs
        val timeMs =
          if (startNs == null) {
            // Event occurred before start, for an example an early cancel.
            0L
          } else {
            TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs)
          }
    
        logger.invoke("[$timeMs ms] $message")
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 6K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

        val startNanos = System.nanoTime()
        while (webSocket.receivedPongCount() < 3) {
          Thread.sleep(50)
        }
        val elapsedUntilPong3 = System.nanoTime() - startNanos
        assertThat(TimeUnit.NANOSECONDS.toMillis(elapsedUntilPong3).toDouble())
          .isCloseTo(1500.0, 250.0)
    
        // The client pinged the server 3 times, and it has ponged back 3 times.
        assertThat(webSocket.sentPingCount()).isEqualTo(3)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Mar 31 17:16:15 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/util/concurrent/RateLimiter.java

      public static RateLimiter create(double permitsPerSecond, Duration warmupPeriod) {
        return create(permitsPerSecond, toNanosSaturated(warmupPeriod), TimeUnit.NANOSECONDS);
      }
    
      /**
       * Creates a {@code RateLimiter} with the specified stable throughput, given as "permits per
       * second" (commonly referred to as <i>QPS</i>, queries per second), and a <i>warmup period</i>,
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:51:36 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  7. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingConnectionListener.kt

        lastTimestampNs = result.timestampNs
    
        if (eventClass != null) {
          assertThat(result).isInstanceOf(eventClass)
        }
    
        if (elapsedMs != -1L) {
          assertThat(
            TimeUnit.NANOSECONDS.toMillis(actualElapsedNs)
              .toDouble(),
          )
            .isCloseTo(elapsedMs.toDouble(), 100.0)
        }
    
        return result
      }
    
      fun recordedEventTypes() = eventSequence.map { it.name }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/cache/CacheBuilder.java

    import static com.google.common.base.Preconditions.checkArgument;
    import static com.google.common.base.Preconditions.checkNotNull;
    import static com.google.common.base.Preconditions.checkState;
    import static java.util.concurrent.TimeUnit.NANOSECONDS;
    
    import com.google.common.annotations.GwtCompatible;
    import com.google.common.annotations.GwtIncompatible;
    import com.google.common.base.Ascii;
    import com.google.common.base.Equivalence;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 52K bytes
    - Viewed (0)
  9. guava/src/com/google/common/util/concurrent/RateLimiter.java

       */
      public static RateLimiter create(double permitsPerSecond, Duration warmupPeriod) {
        return create(permitsPerSecond, toNanosSaturated(warmupPeriod), TimeUnit.NANOSECONDS);
      }
    
      /**
       * Creates a {@code RateLimiter} with the specified stable throughput, given as "permits per
       * second" (commonly referred to as <i>QPS</i>, queries per second), and a <i>warmup period</i>,
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:51:36 UTC 2024
    - 21.6K bytes
    - Viewed (0)
  10. okhttp-testing-support/src/main/kotlin/okhttp3/TestValueFactory.kt

      ): RealConnectionPool {
        return RealConnectionPool(
          taskRunner = taskRunner,
          maxIdleConnections = maxIdleConnections,
          keepAliveDuration = 100L,
          timeUnit = TimeUnit.NANOSECONDS,
          connectionListener = ConnectionListener.NONE,
          exchangeFinderFactory = { pool, address, user ->
            FastFallbackExchangeFinder(
              routePlanner ?: RealRoutePlanner(
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Apr 20 17:03:43 UTC 2024
    - 7.7K bytes
    - Viewed (0)
Back to top