Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for Printf (0.23 sec)

  1. docs/features/events.md

          callStartNanos = nowNanos;
        }
        long elapsedNanos = nowNanos - callStartNanos;
        System.out.printf("%.3f %s%n", elapsedNanos / 1000000000d, name);
      }
    
      @Override public void callStart(Call call) {
        printEvent("callStart");
      }
    
      @Override public void callEnd(Call call) {
        printEvent("callEnd");
      }
    
      @Override public void dnsStart(Call call, String domainName) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 7.7K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/CancelCall.kt

        // 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)
    
        System.out.printf("%.2f Executing call.%n", (System.nanoTime() - startNanos) / 1e9f)
        try {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  3. docs/recipes.md

            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)
    
            System.out.printf("%.2f Executing call.%n", (System.nanoTime() - startNanos) / 1e9f)
            try {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
  4. samples/guide/src/main/java/okhttp3/recipes/CancelCall.java

        // 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);
    
        System.out.printf("%.2f Executing call.%n", (System.nanoTime() - startNanos) / 1e9f);
        try (Response response = call.execute()) {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.1K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/TestTls13Request.kt

      return OkHttpClient.Builder()
        .connectionSpecs(listOf(*specs))
        .build()
    }
    
    private fun sendRequest(
      client: OkHttpClient,
      url: String,
    ) {
      System.out.printf("%-40s ", url)
      System.out.flush()
      println(Platform.get())
      val request =
        Request.Builder()
          .url(url)
          .build()
      try {
        client.newCall(request).execute().use { response ->
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3K bytes
    - Viewed (0)
  6. samples/slack/src/main/java/okhttp3/slack/SlackClient.java

          sessionFactory.start();
        }
    
        HttpUrl authorizeUrl = sessionFactory.newAuthorizeUrl(scopes, team, session -> {
          initOauthSession(session);
          System.out.printf("session granted: %s\n", session);
        });
    
        System.out.printf("open this URL in a browser: %s\n", authorizeUrl);
      }
    
      /** Set the OAuth session for this client. */
      public synchronized void initOauthSession(OAuthSession session) {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.4K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/PrintEvents.java

          final AtomicLong nextCallId = new AtomicLong(1L);
    
          @Override public EventListener create(Call call) {
            long callId = nextCallId.getAndIncrement();
            System.out.printf("%04d %s%n", callId, call.request().url());
            return new PrintingEventListener(callId, System.nanoTime());
          }
        };
    
        final long callId;
        final long callStartNanos;
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 16 23:20:49 GMT 2020
    - 6.1K bytes
    - Viewed (0)
  8. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

          String originalName = currentThread.getName();
          currentThread.setName("Crawler " + url);
          try {
            fetch(url);
          } catch (IOException e) {
            System.out.printf("XXX: %s %s%n", url, e);
          } finally {
            currentThread.setName(originalName);
          }
        }
      }
    
      public void fetch(HttpUrl url) throws IOException {
        // Skip hosts that we've visited many times.
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 4.6K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java

          long nowNanos = System.nanoTime();
          if (name.equals("callStart")) {
            callStartNanos = nowNanos;
          }
          long elapsedNanos = nowNanos - callStartNanos;
          System.out.printf("%.3f %s%n", elapsedNanos / 1000000000d, name);
        }
    
        @Override public void callStart(Call call) {
          printEvent("callStart");
        }
    
        @Override public void proxySelectStart(Call call, HttpUrl url) {
    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)
  10. native-image-tests/src/main/kotlin/okhttp3/DotListener.kt

        reason: String,
      ) {
        printStatus("-")
      }
    
      private fun printStatus(s: String) {
        if (++testCount % 80 == 0) {
          printStatus("\n")
        }
        originalSystemErr?.print(s)
      }
    
      override fun executionFinished(
        testIdentifier: TestIdentifier,
        testExecutionResult: TestExecutionResult,
      ) {
        if (!testIdentifier.isContainer) {
          when (testExecutionResult.status!!) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.2K bytes
    - Viewed (0)
Back to top