Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 69 for nanoTime (5.72 sec)

  1. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

        val webSocket = newWebSocket()
        clientListener.assertOpen()
        val server = serverListener.assertOpen() as RealWebSocket
        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)
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 35.2K bytes
    - Viewed (1)
  2. guava-tests/test/com/google/common/base/SuppliersTest.java

              public Boolean get() {
                // Check that this method is called exactly once, by the first
                // thread to synchronize.
                long t0 = System.nanoTime();
                while (waitingThreads() != numThreads - 1) {
                  if (System.nanoTime() - t0 > timeout) {
                    thrown.set(
                        new TimeoutException(
                            "timed out waiting for other threads to block"
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 18.1K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/base/SuppliersTest.java

              public Boolean get() {
                // Check that this method is called exactly once, by the first
                // thread to synchronize.
                long t0 = System.nanoTime();
                while (waitingThreads() != numThreads - 1) {
                  if (System.nanoTime() - t0 > timeout) {
                    thrown.set(
                        new TimeoutException(
                            "timed out waiting for other threads to block"
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 18.1K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/connection/FastFallbackExchangeFinder.kt

            if (routePlanner.isCanceled()) throw IOException("Canceled")
    
            // Launch a new connection if we're ready to.
            val now = taskRunner.backend.nanoTime()
            var awaitTimeoutNanos = nextTcpConnectAtNanos - now
            var connectResult: ConnectResult? = null
            if (tcpConnectsInFlight.isEmpty() || awaitTimeoutNanos <= 0) {
              connectResult = launchTcpConnect()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java

      }
    
      private static final class PrintingEventListener extends EventListener {
        long callStartNanos;
    
        private void printEvent(String name) {
          long nowNanos = System.nanoTime();
          if (name.equals("callStart")) {
            callStartNanos = nowNanos;
          }
          long elapsedNanos = nowNanos - callStartNanos;
          System.out.printf("%.3f %s%n", elapsedNanos / 1000000000d, name);
        }
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 16 23:20:49 GMT 2020
    - 5.3K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/util/concurrent/MoreExecutors.java

                return true;
              } else if (nanos <= 0) {
                return false;
              } else {
                long now = System.nanoTime();
                TimeUnit.NANOSECONDS.timedWait(lock, nanos);
                nanos -= System.nanoTime() - now; // subtract the actual time we waited
              }
            }
          }
        }
    
        /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 17 16:33:44 GMT 2024
    - 41.8K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnection.kt

        }
      }
    
      internal fun incrementSuccessCount() {
        this.withLock {
          successCount++
        }
      }
    
      @Throws(IOException::class)
      fun start() {
        idleAtNs = System.nanoTime()
        if (protocol == Protocol.HTTP_2 || protocol == Protocol.H2_PRIOR_KNOWLEDGE) {
          startHttp2()
        }
      }
    
      @Throws(IOException::class)
      private fun startHttp2() {
        val socket = this.socket!!
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java

          this.unit = unit;
        }
    
        @Override
        public void run() {
          startTime = System.nanoTime();
          try {
            future.get(timeout, unit);
          } catch (Exception e) {
            // nothing
            exception = e;
          } finally {
            timeSpentBlocked = System.nanoTime() - startTime;
          }
        }
    
        void awaitWaiting() {
          while (!isBlocked()) {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 46.8K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnectionPool.kt

      private val cleanupQueue: TaskQueue = taskRunner.newQueue()
      private val cleanupTask =
        object : Task("$okHttpName ConnectionPool connection closer") {
          override fun runOnce(): Long = closeConnections(System.nanoTime())
        }
    
      private fun AddressState.scheduleOpener() {
        queue.schedule(
          object : Task("$okHttpName ConnectionPool connection opener") {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 16.2K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/InterceptorTest.kt

            .url("http://" + TestUtil.UNREACHABLE_ADDRESS_IPV4)
            .build()
        val call = client.newCall(request1)
        val startNanos = System.nanoTime()
        assertFailsWith<SocketTimeoutException> {
          call.execute()
        }
        val elapsedNanos = System.nanoTime() - startNanos
        org.junit.jupiter.api.Assertions.assertTrue(
          elapsedNanos < TimeUnit.SECONDS.toNanos(5),
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 27.8K bytes
    - Viewed (0)
Back to top