Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 69 for nanoTime (0.17 sec)

  1. okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerTest.kt

        redQueue.execute("task one", 100.µs) {
          log += "one:run@${taskFaker.nanoTime} parallel=${taskFaker.isParallel}"
        }
    
        redQueue.execute("task two", 100.µs) {
          log += "two:run@${taskFaker.nanoTime} parallel=${taskFaker.isParallel}"
        }
    
        redQueue.execute("task three", 100.µs) {
          log += "three:run@${taskFaker.nanoTime} parallel=${taskFaker.isParallel}"
        }
    
        taskFaker.advanceUntil(0.µs)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 20K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/CancelCall.kt

            .build()
    
        val startNanos = System.nanoTime()
        val call = client.newCall(request)
    
        // Schedule a job to cancel the call in 1 second.
        executor.schedule({
          System.out.printf("%.2f Canceling call.%n", (System.nanoTime() - startNanos) / 1e9f)
          call.cancel()
          System.out.printf("%.2f Canceled call.%n", (System.nanoTime() - startNanos) / 1e9f)
        }, 1, TimeUnit.SECONDS)
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/base/Stopwatch.java

     * (by default) uses {@link System#nanoTime}, it is unaffected by these changes.
     *
     * <p>Use this class instead of direct calls to {@link System#nanoTime} for two reasons:
     *
     * <ul>
     *   <li>The raw {@code long} values returned by {@code nanoTime} are meaningless and unsafe to use
     *       in any other way than how {@code Stopwatch} uses them.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Nov 15 21:38:09 GMT 2022
    - 8.5K bytes
    - Viewed (0)
  4. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingEventListener.kt

      override fun requestHeadersStart(call: Call) = logEvent(RequestHeadersStart(System.nanoTime(), call))
    
      override fun requestHeadersEnd(
        call: Call,
        request: Request,
      ) = logEvent(RequestHeadersEnd(System.nanoTime(), call, request.headers.byteCount()))
    
      override fun requestBodyStart(call: Call) = logEvent(RequestBodyStart(System.nanoTime(), call))
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9K bytes
    - Viewed (1)
  5. android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java

          long end = System.nanoTime() + remainingNanos;
    
          while (true) {
            try {
              // CountDownLatch treats negative timeouts just like zero.
              return latch.await(remainingNanos, NANOSECONDS);
            } catch (InterruptedException e) {
              interrupted = true;
              remainingNanos = end - System.nanoTime();
            }
          }
        } finally {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 14.4K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/CancelCall.java

            .build();
    
        final long startNanos = System.nanoTime();
        final Call call = client.newCall(request);
    
        // Schedule a job to cancel the call in 1 second.
        executor.schedule(() -> {
          System.out.printf("%.2f Canceling call.%n", (System.nanoTime() - startNanos) / 1e9f);
          call.cancel();
          System.out.printf("%.2f Canceled call.%n", (System.nanoTime() - startNanos) / 1e9f);
        }, 1, TimeUnit.SECONDS);
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.1K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/AutobahnTester.kt

            override fun onOpen(
              webSocket: WebSocket,
              response: Response,
            ) {
              println("Executing test case $number/$count")
              startNanos.set(System.nanoTime())
            }
    
            override fun onMessage(
              webSocket: WebSocket,
              bytes: ByteString,
            ) {
              webSocket.send(bytes)
            }
    
            override fun onMessage(
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  8. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingConnectionListener.kt

      ) {
        logEvent(ConnectionEvent.ConnectEnd(System.nanoTime(), connection, route, call))
      }
    
      override fun connectionClosed(connection: Connection) = logEvent(ConnectionEvent.ConnectionClosed(System.nanoTime(), connection))
    
      override fun connectionAcquired(
        connection: Connection,
        call: Call,
      ) {
        logEvent(ConnectionEvent.ConnectionAcquired(System.nanoTime(), connection, call))
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskLogger.kt

      if (loggingEnabled) {
        startNs = queue.taskRunner.backend.nanoTime()
        log(task, queue, "starting")
      }
    
      var completedNormally = false
      try {
        val result = block()
        completedNormally = true
        return result
      } finally {
        if (loggingEnabled) {
          val elapsedNs = queue.taskRunner.backend.nanoTime() - startNs
          if (completedNormally) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  10. docs/recipes.md

                .build()
    
            val startNanos = System.nanoTime()
            val call = client.newCall(request)
    
            // Schedule a job to cancel the call in 1 second.
            executor.schedule({
              System.out.printf("%.2f Canceling call.%n", (System.nanoTime() - startNanos) / 1e9f)
              call.cancel()
              System.out.printf("%.2f Canceled call.%n", (System.nanoTime() - startNanos) / 1e9f)
            }, 1, TimeUnit.SECONDS)
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
Back to top