- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for elapsedNanos (0.1 sec)
-
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. *
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Oct 31 14:20:11 UTC 2024 - 9.3K bytes - Viewed (0) -
okhttp/src/test/java/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()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Apr 20 17:03:43 UTC 2024 - 75.4K bytes - Viewed (0) -
docs/features/events.md
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"); } @Override public void callEnd(Call call) {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Feb 06 02:19:09 UTC 2022 - 7.7K bytes - Viewed (0) -
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) -
mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt
connection.getOutputStream().write("ABCDEF".toByteArray(UTF_8)) 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) -
okhttp/src/test/java/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 =
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Jan 14 10:20:09 UTC 2024 - 27.8K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/CallTest.kt
bodySource.use { 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
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Wed Apr 10 19:46:48 UTC 2024 - 142.5K bytes - Viewed (0) -
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); } } }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 19:07:49 UTC 2024 - 149.2K bytes - Viewed (0) -
okhttp/src/test/java/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.
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 20 10:30:28 UTC 2024 - 131.7K bytes - Viewed (0)