- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 145 for ticker (0.08 sec)
-
guava-testlib/src/com/google/common/testing/FakeTicker.java
import com.google.common.annotations.J2ktIncompatible; import com.google.common.base.Ticker; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.time.Duration; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; /** * A Ticker whose value can be advanced programmatically in test. * * <p>The ticker can be configured so that the time is incremented whenever {@link #read} is called:
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 3.6K bytes - Viewed (0) -
android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java
public void testAdvance() { FakeTicker ticker = new FakeTicker(); assertEquals(0, ticker.read()); assertSame(ticker, ticker.advance(10)); assertEquals(10, ticker.read()); ticker.advance(1, MILLISECONDS); assertEquals(1000010L, ticker.read()); ticker.advance(Duration.ofMillis(1)); assertEquals(2000010L, ticker.read()); } public void testAutoIncrementStep_returnsSameInstance() {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Oct 22 13:49:09 UTC 2024 - 6.5K bytes - Viewed (0) -
guava-tests/test/com/google/common/base/StopwatchTest.java
} public void testElapsed_notRunning() { ticker.advance(1); stopwatch.start(); ticker.advance(4); stopwatch.stop(); ticker.advance(9); assertEquals(4, stopwatch.elapsed(NANOSECONDS)); } public void testElapsed_multipleSegments() { stopwatch.start(); ticker.advance(9); stopwatch.stop(); ticker.advance(16); stopwatch.start();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Sep 17 18:14:12 UTC 2024 - 5.7K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/base/StopwatchTest.java
} public void testElapsed_notRunning() { ticker.advance(1); stopwatch.start(); ticker.advance(4); stopwatch.stop(); ticker.advance(9); assertEquals(4, stopwatch.elapsed(NANOSECONDS)); } public void testElapsed_multipleSegments() { stopwatch.start(); ticker.advance(9); stopwatch.stop(); ticker.advance(16); stopwatch.start();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Sep 17 18:14:12 UTC 2024 - 5.7K bytes - Viewed (0) -
guava/src/com/google/common/base/Stopwatch.java
* * @since 15.0 */ public static Stopwatch createStarted(Ticker ticker) { return new Stopwatch(ticker).start(); } Stopwatch() { this.ticker = Ticker.systemTicker(); } Stopwatch(Ticker ticker) { this.ticker = checkNotNull(ticker, "ticker"); } /**
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Oct 31 14:20:11 UTC 2024 - 9.3K bytes - Viewed (0) -
android/guava-testlib/src/com/google/common/testing/FakeTicker.java
import com.google.common.annotations.J2ktIncompatible; import com.google.common.base.Ticker; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.time.Duration; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; /** * A Ticker whose value can be advanced programmatically in test. * * <p>The ticker can be configured so that the time is incremented whenever {@link #read} is called:
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 4.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/cache/LocalCacheTest.java
ticker.advance(1); segment.recordRead(entry, ticker.read()); segment.expireEntries(ticker.read()); assertTrue(map.containsKey(key)); assertSame(entry, segment.accessQueue.peek()); assertEquals(1, segment.accessQueue.size()); ticker.advance(1); segment.recordRead(entry, ticker.read()); segment.expireEntries(ticker.read());
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 19:07:49 UTC 2024 - 110.6K bytes - Viewed (0) -
guava-tests/test/com/google/common/cache/LocalCacheTest.java
ticker.advance(1); segment.recordRead(entry, ticker.read()); segment.expireEntries(ticker.read()); assertTrue(map.containsKey(key)); assertSame(entry, segment.accessQueue.peek()); assertEquals(1, segment.accessQueue.size()); ticker.advance(1); segment.recordRead(entry, ticker.read()); segment.expireEntries(ticker.read());
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 19:07:49 UTC 2024 - 112.3K bytes - Viewed (0) -
guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java
assertEquals(Integer.valueOf(6), cache.apply(7)); } public void testExpireAfterAccess() { final Cache<Integer, Integer> cache = CacheBuilder.newBuilder().expireAfterAccess(1000, MILLISECONDS).ticker(fakeTicker).build(); cache.put(0, 10); cache.put(2, 30); fakeTicker.advance(999, MILLISECONDS); assertEquals(Integer.valueOf(30), cache.getIfPresent(2));
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 19:07:49 UTC 2024 - 14.4K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java
return immediateFuture(two); } }; LoadingCache<Object, Object> cache = CacheBuilder.newBuilder() .recordStats() .ticker(ticker) .refreshAfterWrite(1, MILLISECONDS) .build(loader); Object key = new Object(); CacheStats stats = cache.stats(); assertEquals(0, stats.missCount());
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 19:07:49 UTC 2024 - 86.3K bytes - Viewed (0)