- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 44 for toNanos (0.21 sec)
-
guava/src/com/google/common/cache/CacheBuilderSpec.java
* nanos to match CacheBuilder implementation. */ @CheckForNull private static Long durationInNanos(long duration, @CheckForNull TimeUnit unit) { return (unit == null) ? null : unit.toNanos(duration); } /** Base class for parsing integers. */ abstract static class IntegerParser implements ValueParser { protected abstract void parseInteger(CacheBuilderSpec spec, int value);
Java - Registered: Fri Apr 05 12:43:09 GMT 2024 - Last Modified: Mon Aug 22 14:27:44 GMT 2022 - 18.1K bytes - Viewed (0) -
android/guava/src/com/google/common/base/Suppliers.java
Supplier<T> delegate, long duration, TimeUnit unit) { checkNotNull(delegate); checkArgument(duration > 0, "duration (%s %s) must be > 0", duration, unit); return new ExpiringMemoizingSupplier<>(delegate, unit.toNanos(duration)); } /** * Returns a supplier that caches the instance supplied by the delegate and removes the cached * value after the specified time has passed. Subsequent calls to {@code get()} return the cached
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Mon Apr 01 16:15:01 GMT 2024 - 15.3K bytes - Viewed (0) -
android/guava/src/com/google/common/util/concurrent/Monitor.java
} } /** * Returns unit.toNanos(time), additionally ensuring the returned value is not at risk of * overflowing or underflowing, by bounding the value between 0 and (Long.MAX_VALUE / 4) * 3. * Actually waiting for more than 219 years is not supported! */ private static long toSafeNanos(long time, TimeUnit unit) { long timeoutNanos = unit.toNanos(time);
Java - Registered: Fri Apr 26 12:43:10 GMT 2024 - Last Modified: Mon Dec 04 18:22:01 GMT 2023 - 38.6K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java
} void sleepMillis(int millis) { sleepMicros("U", MILLISECONDS.toMicros(millis)); } void sleepMicros(String caption, long micros) { instant += MICROSECONDS.toNanos(micros); events.add(caption + String.format(Locale.ROOT, "%3.2f", (micros / 1000000.0))); } @Override protected void sleepMicrosUninterruptibly(long micros) { sleepMicros("R", micros);
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Wed Sep 06 17:04:31 GMT 2023 - 21.6K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java
} void sleepMillis(int millis) { sleepMicros("U", MILLISECONDS.toMicros(millis)); } void sleepMicros(String caption, long micros) { instant += MICROSECONDS.toNanos(micros); events.add(caption + String.format(Locale.ROOT, "%3.2f", (micros / 1000000.0))); } @Override protected void sleepMicrosUninterruptibly(long micros) { sleepMicros("R", micros);
Java - Registered: Fri Apr 12 12:43:09 GMT 2024 - Last Modified: Wed Sep 06 17:04:31 GMT 2023 - 21.6K 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 = Interceptor { chainA: Interceptor.Chain ->
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun Jan 14 10:20:09 GMT 2024 - 27.8K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Connection.kt
// Guarded by this. private val currentPushRequests = mutableSetOf<Int>() init { if (builder.pingIntervalMillis != 0) { val pingIntervalNanos = TimeUnit.MILLISECONDS.toNanos(builder.pingIntervalMillis.toLong()) writerQueue.schedule("$connectionName ping", pingIntervalNanos) { val failDueToMissingPong = this.withLock {
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Apr 20 17:03:43 GMT 2024 - 32.6K bytes - Viewed (0) -
guava-tests/test/com/google/common/cache/LocalCacheTest.java
assertEquals(unit.toNanos(duration), map.expireAfterWriteNanos); } public void testSetExpireAfterAccess() { long duration = 42; TimeUnit unit = TimeUnit.SECONDS; LocalCache<Object, Object> map = makeLocalCache(createCacheBuilder().expireAfterAccess(duration, unit)); assertEquals(unit.toNanos(duration), map.expireAfterAccessNanos); }
Java - Registered: Fri Apr 19 12:43:09 GMT 2024 - Last Modified: Thu Mar 14 23:06:48 GMT 2024 - 112.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/cache/LocalCacheTest.java
assertEquals(unit.toNanos(duration), map.expireAfterWriteNanos); } public void testSetExpireAfterAccess() { long duration = 42; TimeUnit unit = TimeUnit.SECONDS; LocalCache<Object, Object> map = makeLocalCache(createCacheBuilder().expireAfterAccess(duration, unit)); assertEquals(unit.toNanos(duration), map.expireAfterAccessNanos); }
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Thu Mar 14 23:06:48 GMT 2024 - 110.7K bytes - Viewed (0) -
android/guava/src/com/google/common/util/concurrent/AbstractFuture.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. final long timeoutNanos = unit.toNanos(timeout); // we rely on the implicit null check on unit. long remainingNanos = timeoutNanos; if (Thread.interrupted()) { throw new InterruptedException(); } Object localValue = value;
Java - Registered: Fri Apr 26 12:43:10 GMT 2024 - Last Modified: Mon Apr 22 21:17:24 GMT 2024 - 63K bytes - Viewed (0)