- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 32 for toNanos (0.07 seconds)
-
android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java
public static boolean awaitUninterruptibly(CountDownLatch latch, long timeout, TimeUnit unit) { boolean interrupted = false; try { long remainingNanos = unit.toNanos(timeout); long end = System.nanoTime() + remainingNanos; while (true) { try { // CountDownLatch treats negative timeouts just like zero.
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Jan 29 23:24:32 GMT 2026 - 22.5K bytes - Click Count (0) -
android/guava-testlib/src/com/google/common/testing/GcFinalization.java
public static void awaitDone(Future<?> future) { if (future.isDone()) { return; } long timeoutSeconds = timeoutSeconds(); long deadline = System.nanoTime() + SECONDS.toNanos(timeoutSeconds); do { System.runFinalization(); if (future.isDone()) { return; } System.gc(); try { future.get(1L, SECONDS); return;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Mar 12 20:19:19 GMT 2026 - 12.3K bytes - Click Count (0) -
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.7K bytes - Click Count (0) -
guava-testlib/src/com/google/common/testing/GcFinalization.java
public static void awaitDone(Future<?> future) { if (future.isDone()) { return; } long timeoutSeconds = timeoutSeconds(); long deadline = System.nanoTime() + SECONDS.toNanos(timeoutSeconds); do { System.runFinalization(); if (future.isDone()) { return; } System.gc(); try { future.get(1L, SECONDS); return;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Mar 12 20:19:19 GMT 2026 - 12.3K bytes - Click Count (0) -
android/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java
} @Override public boolean equals(@Nullable Object o) { if (o instanceof DurationSpec) { DurationSpec that = (DurationSpec) o; return unit.toNanos(duration) == that.unit.toNanos(that.duration); } return false; } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("duration", duration)Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Wed Mar 18 18:06:14 GMT 2026 - 7.5K 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/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)