Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 8 of 8 for elapsedNanos (0.08 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. api/maven-api-core/src/main/java/org/apache/maven/api/MonotonicClock.java

         * with the wall clock time.
         *
         * @return the current instant using monotonic timing
         */
        @Override
        public Instant instant() {
            long elapsedNanos = System.nanoTime() - startNanos;
            return startInstant.plusNanos(elapsedNanos);
        }
    
        /**
         * Returns the wall clock time captured when this monotonic clock was initialized.
         * <p>
    Created: Sun Dec 28 03:35:09 GMT 2025
    - Last Modified: Wed Jan 15 06:28:29 GMT 2025
    - 5.6K bytes
    - Click Count (0)
  2. guava/src/com/google/common/base/Stopwatch.java

        return isRunning ? ticker.read() - startTick + elapsedNanos : elapsedNanos;
      }
    
      /**
       * Returns the current elapsed time shown on this stopwatch, expressed in the desired time unit,
       * with any fraction rounded down.
       *
       * <p><b>Note:</b> the overhead of measurement can be more than a microsecond, so it is generally
       * not useful to specify {@link TimeUnit#NANOSECONDS} precision here.
       *
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Wed Oct 08 18:55:33 GMT 2025
    - 9.2K bytes
    - Click Count (0)
  3. samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java

        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);
        }
    
        @Override public void callStart(Call call) {
          printEvent("callStart");
        }
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sun Feb 16 23:20:49 GMT 2020
    - 5.3K 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 =
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 04 16:11:23 GMT 2025
    - 28.2K bytes
    - Click Count (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/internal/http2/Http2ConnectionTest.kt

        // Play it back.
        val connection = connect(peer)
        val pingAtNanos = System.nanoTime()
        connection.writePingAndAwaitPong()
        val elapsedNanos = System.nanoTime() - pingAtNanos
        assertThat(elapsedNanos).isGreaterThan(0L)
        assertThat(elapsedNanos).isLessThan(TimeUnit.SECONDS.toNanos(1))
    
        // Verify the peer received what was expected.
        val pingFrame = peer.takeFrame()
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Thu Jul 31 04:18:40 GMT 2025
    - 75.5K bytes
    - Click Count (0)
  6. okhttp/src/jvmTest/kotlin/okhttp3/CallTest.kt

          assertFailsWith<IOException> {
            bodySource.readByte()
          }.also { expected ->
            // Timed out as expected.
            val elapsedNanos = System.nanoTime() - startNanos
            val elapsedMillis = TimeUnit.NANOSECONDS.toMillis(elapsedNanos)
            assertThat(elapsedMillis).isLessThan(500)
          }
        }
      }
    
      /** https://github.com/square/okhttp/issues/442  */
      @Test
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 04 19:13:52 GMT 2025
    - 147.4K bytes
    - Click Count (0)
  7. guava/src/com/google/common/cache/LocalCache.java

            }
            statsCounter.recordLoadSuccess(loadingValueReference.elapsedNanos());
            storeLoadedValue(key, hash, loadingValueReference, value);
            return value;
          } finally {
            if (value == null) {
              statsCounter.recordLoadException(loadingValueReference.elapsedNanos());
              removeLoadingValue(key, hash, loadingValueReference);
            }
          }
        }
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Sep 11 19:35:11 GMT 2025
    - 148.9K bytes
    - Click Count (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/URLConnectionTest.kt

        val connection1 = getResponse(newRequest("/"))
        val inputStream = connection1.body.byteStream()
        inputStream.close()
        val elapsedNanos = System.nanoTime() - startNanos
        val elapsedMillis = TimeUnit.NANOSECONDS.toMillis(elapsedNanos)
    
        // If we're working correctly, this should be greater than 100ms, but less than double that.
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Jun 21 20:36:35 GMT 2025
    - 133.2K bytes
    - Click Count (0)
Back to Top