- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 62 for nanotime1 (0.2 sec)
-
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)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Mar 31 17:16:15 UTC 2024 - 35.2K bytes - Viewed (0) -
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"
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 17.9K bytes - Viewed (0) -
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"
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 17.9K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskQueue.kt
internal fun scheduleAndDecide( task: Task, delayNanos: Long, recurrence: Boolean, ): Boolean { task.initQueue(this) val now = taskRunner.backend.nanoTime() val executeNanoTime = now + delayNanos // If the task is already scheduled, take the earlier of the two times. val existingIndex = futureTasks.indexOf(task) if (existingIndex != -1) {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 7.5K bytes - Viewed (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt
} } private fun ensureAllTaskQueuesIdle() { val entryTime = System.nanoTime() for (queue in TaskRunner.INSTANCE.activeQueues()) { // We wait at most 1 second, so we don't ever turn multiple lost threads into // a test timeout failure. val waitTime = (entryTime + 1_000_000_000L - System.nanoTime()) if (!queue.idleLatch().await(waitTime, TimeUnit.NANOSECONDS)) {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 10.5K bytes - Viewed (0) -
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); }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Feb 16 23:20:49 UTC 2020 - 5.3K bytes - Viewed (0) -
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()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 5.8K bytes - Viewed (0) -
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!!
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Apr 20 17:03:43 UTC 2024 - 15.4K bytes - Viewed (0) -
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") {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Apr 20 17:03:43 UTC 2024 - 16.2K bytes - Viewed (0) -
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),
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Jan 14 10:20:09 UTC 2024 - 27.8K bytes - Viewed (0)