- Sort Score
- Num 10 results
- Language All
Results 11 - 20 of 45 for toNanos (0.23 seconds)
-
android/guava/src/com/google/common/util/concurrent/Internal.java
// Using a try/catch seems lazy, but the catch block will rarely get invoked (except for // durations longer than approximately +/- 292 years). try { return duration.toNanos(); } catch (ArithmeticException tooBig) { return duration.isNegative() ? Long.MIN_VALUE : Long.MAX_VALUE; } } private Internal() {}
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Apr 14 16:07:06 GMT 2025 - 1.8K bytes - Click Count (0) -
android/guava/src/com/google/common/collect/Internal.java
// Using a try/catch seems lazy, but the catch block will rarely get invoked (except for // durations longer than approximately +/- 292 years). try { return duration.toNanos(); } catch (ArithmeticException tooBig) { return duration.isNegative() ? Long.MIN_VALUE : Long.MAX_VALUE; } } private Internal() {}
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue Nov 04 17:24:58 GMT 2025 - 1.8K bytes - Click Count (0) -
android/guava/src/com/google/common/base/Internal.java
// Using a try/catch seems lazy, but the catch block will rarely get invoked (except for // durations longer than approximately +/- 292 years). try { return duration.toNanos(); } catch (ArithmeticException tooBig) { return duration.isNegative() ? Long.MIN_VALUE : Long.MAX_VALUE; } } private Internal() {}
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Apr 14 15:16:19 GMT 2025 - 1.9K bytes - Click Count (0) -
android/guava/src/com/google/common/util/concurrent/DirectExecutorService.java
synchronized (lock) { return shutdown && runningTasks == 0; } } @Override public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); synchronized (lock) { while (true) { if (shutdown && runningTasks == 0) { return true; } else if (nanos <= 0) { return false; } else {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue Dec 16 14:23:59 GMT 2025 - 3.4K bytes - Click Count (0) -
android/guava/src/com/google/common/util/concurrent/ListenableFutureTask.java
} @CanIgnoreReturnValue @Override @ParametricNullness public V get(long timeout, TimeUnit unit) throws TimeoutException, InterruptedException, ExecutionException { long timeoutNanos = unit.toNanos(timeout); if (timeoutNanos <= OverflowAvoidingLockSupport.MAX_NANOSECONDS_THRESHOLD) { return super.get(timeout, unit); } // Waiting 68 years should be enough for any program. return super.get(
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue Feb 10 11:51:21 GMT 2026 - 4.2K bytes - Click Count (0) -
android/guava/src/com/google/common/cache/CacheBuilder.java
"expireAfterWrite was already set to %s ns", expireAfterWriteNanos); checkArgument(duration >= 0, "duration cannot be negative: %s %s", duration, unit); this.expireAfterWriteNanos = unit.toNanos(duration); return this; } @SuppressWarnings("GoodTime") // nanos internally, should be Duration long getExpireAfterWriteNanos() {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Feb 23 13:13:59 GMT 2026 - 52K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/FastFallbackExchangeFinder.kt
*/ internal class FastFallbackExchangeFinder( override val routePlanner: RoutePlanner, private val taskRunner: TaskRunner, ) : ExchangeFinder { private val connectDelayNanos = TimeUnit.MILLISECONDS.toNanos(250L) private var nextTcpConnectAtNanos = Long.MIN_VALUE /** * Plans currently being connected, and that will later be added to [connectResults]. This is
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Jan 27 09:00:39 GMT 2026 - 5.8K bytes - Click Count (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt
override fun poll(): T = delegate.poll() override fun poll( timeout: Long, unit: TimeUnit, ): T? { return taskRunner.withLock { val waitUntil = nanoTime + unit.toNanos(timeout) while (true) { val result = poll() if (result != null) return@withLock result if (nanoTime >= waitUntil) return@withLock null val editCountBefore = editCountCreated: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed May 28 23:28:25 GMT 2025 - 11.9K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/WholeOperationTimeoutTest.kt
.newBuilder() .callTimeout(Duration.ofMillis(456)) .build() val call = timeoutClient.newCall(request) assertThat(call.timeout().timeoutNanos()) .isEqualTo(TimeUnit.MILLISECONDS.toNanos(456)) } @Test fun timeoutWritingRequest() { server.enqueue(MockResponse()) val request = Request .Builder() .url(server.url("/"))
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Jun 18 12:28:21 GMT 2025 - 10.6K bytes - Click Count (0) -
android/guava/src/com/google/common/util/concurrent/AbstractFutureState.java
// NOTE: if timeout < 0, remainingNanos will be < 0 and we will fall into the while(true) loop // at the bottom and throw a timeoutexception. long timeoutNanos = unit.toNanos(timeout); // we rely on the implicit null check on unit. long remainingNanos = timeoutNanos; if (Thread.interrupted()) { throw new InterruptedException(); }
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Aug 07 16:05:33 GMT 2025 - 33.2K bytes - Click Count (0)