Home
last modified time | relevance | path

Searched refs:ticker (Results 1 – 25 of 100) sorted by relevance

1234

/external/guava/guava-testlib/test/com/google/common/testing/
DFakeTickerTest.java46 FakeTicker ticker = new FakeTicker(); in testAdvance() local
47 assertEquals(0, ticker.read()); in testAdvance()
48 assertSame(ticker, ticker.advance(10)); in testAdvance()
49 assertEquals(10, ticker.read()); in testAdvance()
50 ticker.advance(1, TimeUnit.MILLISECONDS); in testAdvance()
51 assertEquals(1000010L, ticker.read()); in testAdvance()
52 ticker.advance(java.time.Duration.ofMillis(1)); in testAdvance()
53 assertEquals(2000010L, ticker.read()); in testAdvance()
57 FakeTicker ticker = new FakeTicker(); in testAutoIncrementStep_returnsSameInstance() local
58 assertSame(ticker, ticker.setAutoIncrementStep(10, TimeUnit.NANOSECONDS)); in testAutoIncrementStep_returnsSameInstance()
[all …]
/external/guava/android/guava-testlib/test/com/google/common/testing/
DFakeTickerTest.java45 FakeTicker ticker = new FakeTicker(); in testAdvance() local
46 assertEquals(0, ticker.read()); in testAdvance()
47 assertSame(ticker, ticker.advance(10)); in testAdvance()
48 assertEquals(10, ticker.read()); in testAdvance()
49 ticker.advance(1, TimeUnit.MILLISECONDS); in testAdvance()
50 assertEquals(1000010L, ticker.read()); in testAdvance()
54 FakeTicker ticker = new FakeTicker(); in testAutoIncrementStep_returnsSameInstance() local
55 assertSame(ticker, ticker.setAutoIncrementStep(10, TimeUnit.NANOSECONDS)); in testAutoIncrementStep_returnsSameInstance()
59 FakeTicker ticker = new FakeTicker().setAutoIncrementStep(10, TimeUnit.NANOSECONDS); in testAutoIncrementStep_nanos() local
60 assertEquals(0, ticker.read()); in testAutoIncrementStep_nanos()
[all …]
/external/guava/guava-tests/test/com/google/common/cache/
DCacheExpirationTest.java50 FakeTicker ticker = new FakeTicker(); in testExpiration_expireAfterWrite() local
57 .ticker(ticker) in testExpiration_expireAfterWrite()
59 checkExpiration(cache, loader, ticker, removalListener); in testExpiration_expireAfterWrite()
63 FakeTicker ticker = new FakeTicker(); in testExpiration_expireAfterAccess() local
70 .ticker(ticker) in testExpiration_expireAfterAccess()
72 checkExpiration(cache, loader, ticker, removalListener); in testExpiration_expireAfterAccess()
78 FakeTicker ticker, in checkExpiration() argument
91 CacheTesting.expireEntries((LoadingCache<?, ?>) cache, EXPIRING_TIME, ticker); in checkExpiration() local
96 CacheTesting.expireEntries((LoadingCache<?, ?>) cache, EXPIRING_TIME, ticker); in checkExpiration() local
102 FakeTicker ticker = new FakeTicker(); in testExpiringGet_expireAfterWrite() local
[all …]
DCacheRefreshTest.java31 FakeTicker ticker = new FakeTicker(); in testAutoRefresh() local
38 .ticker(ticker) in testAutoRefresh()
47 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
57 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
67 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
75 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
83 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
91 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
/external/guava/android/guava-tests/test/com/google/common/cache/
DCacheExpirationTest.java50 FakeTicker ticker = new FakeTicker(); in testExpiration_expireAfterWrite() local
57 .ticker(ticker) in testExpiration_expireAfterWrite()
59 checkExpiration(cache, loader, ticker, removalListener); in testExpiration_expireAfterWrite()
63 FakeTicker ticker = new FakeTicker(); in testExpiration_expireAfterAccess() local
70 .ticker(ticker) in testExpiration_expireAfterAccess()
72 checkExpiration(cache, loader, ticker, removalListener); in testExpiration_expireAfterAccess()
78 FakeTicker ticker, in checkExpiration() argument
91 CacheTesting.expireEntries((LoadingCache<?, ?>) cache, EXPIRING_TIME, ticker); in checkExpiration() local
96 CacheTesting.expireEntries((LoadingCache<?, ?>) cache, EXPIRING_TIME, ticker); in checkExpiration() local
102 FakeTicker ticker = new FakeTicker(); in testExpiringGet_expireAfterWrite() local
[all …]
DCacheRefreshTest.java31 FakeTicker ticker = new FakeTicker(); in testAutoRefresh() local
38 .ticker(ticker) in testAutoRefresh()
47 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
57 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
67 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
75 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
83 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
91 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
/external/guava/guava-tests/test/com/google/common/base/
DStopwatchTest.java37 private final FakeTicker ticker = new FakeTicker(); field in StopwatchTest
38 private final Stopwatch stopwatch = new Stopwatch(ticker);
98 ticker.advance(1); in testReset_new()
101 ticker.advance(2); in testReset_new()
104 ticker.advance(3); in testReset_new()
109 ticker.advance(1); in testReset_whileRunning()
112 ticker.advance(2); in testReset_whileRunning()
116 ticker.advance(3); in testReset_whileRunning()
121 ticker.advance(78); in testElapsed_whileRunning()
125 ticker.advance(345); in testElapsed_whileRunning()
[all …]
/external/guava/android/guava-tests/test/com/google/common/base/
DStopwatchTest.java35 private final FakeTicker ticker = new FakeTicker(); field in StopwatchTest
36 private final Stopwatch stopwatch = new Stopwatch(ticker);
96 ticker.advance(1); in testReset_new()
99 ticker.advance(2); in testReset_new()
102 ticker.advance(3); in testReset_new()
107 ticker.advance(1); in testReset_whileRunning()
110 ticker.advance(2); in testReset_whileRunning()
114 ticker.advance(3); in testReset_whileRunning()
119 ticker.advance(78); in testElapsed_whileRunning()
123 ticker.advance(345); in testElapsed_whileRunning()
[all …]
/external/jemalloc_new/include/jemalloc/internal/
Dticker.h20 ticker_init(ticker_t *ticker, int32_t nticks) { in ticker_init() argument
21 ticker->tick = nticks; in ticker_init()
22 ticker->nticks = nticks; in ticker_init()
26 ticker_copy(ticker_t *ticker, const ticker_t *other) { in ticker_copy() argument
27 *ticker = *other; in ticker_copy()
31 ticker_read(const ticker_t *ticker) { in ticker_read() argument
32 return ticker->tick; in ticker_read()
59 ticker_fixup(ticker_t *ticker) { in ticker_fixup() argument
60 ticker->tick = ticker->nticks; in ticker_fixup()
65 ticker_ticks(ticker_t *ticker, int32_t nticks) { in ticker_ticks() argument
[all …]
/external/grpc-grpc-java/context/src/test/java/io/grpc/
DDeadlineTest.java56 private FakeTicker ticker = new FakeTicker(); field in DeadlineTest
59 ticker.reset(epoch); in DeadlineTest()
65 ticker.reset(System.nanoTime()); in defaultTickerIsSystemTicker()
66 Deadline reference = Deadline.after(0, TimeUnit.SECONDS, ticker); in defaultTickerIsSystemTicker()
73 ticker.reset(Long.MAX_VALUE); in timeCanOverflow()
74 Deadline d = Deadline.after(10, TimeUnit.DAYS, ticker); in timeCanOverflow()
76 assertTrue(Deadline.after(0, TimeUnit.DAYS, ticker).isBefore(d)); in timeCanOverflow()
79 ticker.increment(10, TimeUnit.DAYS); in timeCanOverflow()
85 ticker.reset(Long.MIN_VALUE); in timeCanUnderflow()
86 Deadline d = Deadline.after(-10, TimeUnit.DAYS, ticker); in timeCanUnderflow()
[all …]
/external/jemalloc_new/test/unit/
Dticker.c8 ticker_t ticker; in TEST_BEGIN() local
11 ticker_init(&ticker, NTICKS); in TEST_BEGIN()
14 assert_u_eq(ticker_read(&ticker), NTICKS - j, in TEST_BEGIN()
16 assert_false(ticker_tick(&ticker), in TEST_BEGIN()
19 assert_u32_eq(ticker_read(&ticker), 0, in TEST_BEGIN()
21 assert_true(ticker_tick(&ticker), in TEST_BEGIN()
23 assert_u32_eq(ticker_read(&ticker), NTICKS, in TEST_BEGIN()
32 ticker_t ticker; in TEST_BEGIN() local
34 ticker_init(&ticker, NTICKS); in TEST_BEGIN()
36 assert_u_eq(ticker_read(&ticker), NTICKS, "Unexpected ticker value"); in TEST_BEGIN()
[all …]
/external/dagger2/java/dagger/producers/monitoring/
DTimingProductionComponentMonitor.java34 private final Ticker ticker; field in TimingProductionComponentMonitor
37 TimingProductionComponentMonitor(ProductionComponentTimingRecorder recorder, Ticker ticker) { in TimingProductionComponentMonitor() argument
39 this.ticker = ticker; in TimingProductionComponentMonitor()
40 this.stopwatch = Stopwatch.createStarted(ticker); in TimingProductionComponentMonitor()
45 return new TimingProducerMonitor(recorder.producerTimingRecorderFor(token), ticker, stopwatch); in producerMonitorFor()
50 private final Ticker ticker; field in TimingProductionComponentMonitor.Factory
56 Factory(ProductionComponentTimingRecorder.Factory recorderFactory, Ticker ticker) { in Factory() argument
58 this.ticker = ticker; in Factory()
63 return new TimingProductionComponentMonitor(recorderFactory.create(component), ticker); in create()
/external/grpc-grpc-java/netty/src/test/java/io/grpc/netty/
DKeepAliveEnforcerTest.java31 private FakeTicker ticker = new FakeTicker(); field in KeepAliveEnforcerTest
45 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(true, 0, TimeUnit.NANOSECONDS, ticker); in permitLimitless()
65 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(false, 0, TimeUnit.NANOSECONDS, ticker); in strikeOutBecauseNoOutstandingCalls()
75 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(false, 0, TimeUnit.NANOSECONDS, ticker); in startsIdle()
84 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(true, 1, TimeUnit.NANOSECONDS, ticker); in strikeOutBecauseRateTooHighWhileActive()
94 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(true, 1, TimeUnit.NANOSECONDS, ticker); in strikeOutBecauseRateTooHighWhileIdle()
104 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(false, 1, TimeUnit.NANOSECONDS, ticker); in permitInRateWhileActive()
108 ticker.nanoTime += 1; in permitInRateWhileActive()
114 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(true, 1, TimeUnit.NANOSECONDS, ticker); in permitInRateWhileIdle()
118 ticker.nanoTime += 1; in permitInRateWhileIdle()
[all …]
/external/dagger2/javatests/dagger/producers/monitoring/
DTimingProductionComponentMonitorTest.java43 private FakeTicker ticker; field in TimingProductionComponentMonitorTest
59 ticker = new FakeTicker(); in setUp()
62 productionComponentTimingRecorderFactory, ticker); in setUp()
70 ticker.advance(5000222); in normalExecution_success()
72 ticker.advance(1333); in normalExecution_success()
74 ticker.advance(40000555); in normalExecution_success()
78 ticker.advance(2000777); in normalExecution_success()
80 ticker.advance(3000999); in normalExecution_success()
82 ticker.advance(100000222); in normalExecution_success()
99 ticker.advance(5000222); in normalExecution_failure()
[all …]
/external/grpc-grpc-java/context/src/main/java/io/grpc/
DDeadline.java51 static Deadline after(long duration, TimeUnit units, Ticker ticker) { in after() argument
53 return new Deadline(ticker, units.toNanos(duration), true); in after()
56 private final Ticker ticker; field in Deadline
60 private Deadline(Ticker ticker, long offset, boolean baseInstantAlreadyExpired) { in Deadline() argument
61 this(ticker, ticker.read(), offset, baseInstantAlreadyExpired); in Deadline()
64 private Deadline(Ticker ticker, long baseInstant, long offset, in Deadline() argument
66 this.ticker = ticker; in Deadline()
79 if (deadlineNanos - ticker.read() <= 0) { in isExpired()
114 return new Deadline(ticker, deadlineNanos, units.toNanos(offset), isExpired()); in offset()
124 final long nowNanos = ticker.read(); in timeRemaining()
[all …]
/external/guava/android/guava/src/com/google/common/base/
DStopwatch.java91 private final Ticker ticker; field in Stopwatch
110 public static Stopwatch createUnstarted(Ticker ticker) { in createUnstarted() argument
111 return new Stopwatch(ticker); in createUnstarted()
128 public static Stopwatch createStarted(Ticker ticker) { in createStarted() argument
129 return new Stopwatch(ticker).start(); in createStarted()
133 this.ticker = Ticker.systemTicker(); in Stopwatch()
136 Stopwatch(Ticker ticker) { in Stopwatch() argument
137 this.ticker = checkNotNull(ticker, "ticker"); in Stopwatch()
158 startTick = ticker.read(); in start()
171 long tick = ticker.read(); in stop()
[all …]
/external/guava/guava/src/com/google/common/base/
DStopwatch.java93 private final Ticker ticker; field in Stopwatch
112 public static Stopwatch createUnstarted(Ticker ticker) { in createUnstarted() argument
113 return new Stopwatch(ticker); in createUnstarted()
130 public static Stopwatch createStarted(Ticker ticker) { in createStarted() argument
131 return new Stopwatch(ticker).start(); in createStarted()
135 this.ticker = Ticker.systemTicker(); in Stopwatch()
138 Stopwatch(Ticker ticker) { in Stopwatch() argument
139 this.ticker = checkNotNull(ticker, "ticker"); in Stopwatch()
160 startTick = ticker.read(); in start()
173 long tick = ticker.read(); in stop()
[all …]
/external/caliper/caliper/src/main/java/com/google/caliper/worker/
DRuntimeWorker.java45 protected final Ticker ticker; field in RuntimeWorker
52 Method method, Random random, Ticker ticker, in RuntimeWorker() argument
57 this.ticker = ticker; in RuntimeWorker()
105 @BenchmarkMethod Method method, Random random, Ticker ticker, in Micro() argument
107 super(benchmark, method, random, ticker, workerOptions); in Micro()
120 long before = ticker.read(); in invokeTimeMethod()
122 return ticker.read() - before; in invokeTimeMethod()
131 @BenchmarkMethod Method method, Random random, Ticker ticker, in Pico() argument
133 super(benchmark, method, random, ticker, workerOptions); in Pico()
137 long before = ticker.read(); in invokeTimeMethod()
[all …]
/external/rust/crates/grpcio-sys/grpc/third_party/abseil-cpp/absl/synchronization/internal/
Dper_thread_sem.cc45 identity->ticker.store(0, std::memory_order_relaxed); in Init()
55 const int ticker = in Tick() local
56 identity->ticker.fetch_add(1, std::memory_order_relaxed) + 1; in Tick()
59 if (wait_start && (ticker - wait_start > Waiter::kIdlePeriods) && !is_idle) { in Tick()
83 int ticker = identity->ticker.load(std::memory_order_relaxed); in AbslInternalPerThreadSemWait() local
84 identity->wait_start.store(ticker ? ticker : 1, std::memory_order_relaxed); in AbslInternalPerThreadSemWait()
/external/openscreen/third_party/abseil/src/absl/synchronization/internal/
Dper_thread_sem.cc45 identity->ticker.store(0, std::memory_order_relaxed); in Init()
55 const int ticker = in Tick() local
56 identity->ticker.fetch_add(1, std::memory_order_relaxed) + 1; in Tick()
59 if (wait_start && (ticker - wait_start > Waiter::kIdlePeriods) && !is_idle) { in Tick()
83 int ticker = identity->ticker.load(std::memory_order_relaxed); in AbslInternalPerThreadSemWait() local
84 identity->wait_start.store(ticker ? ticker : 1, std::memory_order_relaxed); in AbslInternalPerThreadSemWait()
/external/libtextclassifier/abseil-cpp/absl/synchronization/internal/
Dper_thread_sem.cc45 identity->ticker.store(0, std::memory_order_relaxed); in Init()
55 const int ticker = in Tick() local
56 identity->ticker.fetch_add(1, std::memory_order_relaxed) + 1; in Tick()
59 if (wait_start && (ticker - wait_start > Waiter::kIdlePeriods) && !is_idle) { in Tick()
83 int ticker = identity->ticker.load(std::memory_order_relaxed); in AbslInternalPerThreadSemWait() local
84 identity->wait_start.store(ticker ? ticker : 1, std::memory_order_relaxed); in AbslInternalPerThreadSemWait()
/external/webrtc/third_party/abseil-cpp/absl/synchronization/internal/
Dper_thread_sem.cc45 identity->ticker.store(0, std::memory_order_relaxed); in Init()
55 const int ticker = in Tick() local
56 identity->ticker.fetch_add(1, std::memory_order_relaxed) + 1; in Tick()
59 if (wait_start && (ticker - wait_start > Waiter::kIdlePeriods) && !is_idle) { in Tick()
83 int ticker = identity->ticker.load(std::memory_order_relaxed); in AbslInternalPerThreadSemWait() local
84 identity->wait_start.store(ticker ? ticker : 1, std::memory_order_relaxed); in AbslInternalPerThreadSemWait()
/external/angle/third_party/abseil-cpp/absl/synchronization/internal/
Dper_thread_sem.cc45 identity->ticker.store(0, std::memory_order_relaxed); in Init()
55 const int ticker = in Tick() local
56 identity->ticker.fetch_add(1, std::memory_order_relaxed) + 1; in Tick()
59 if (wait_start && (ticker - wait_start > Waiter::kIdlePeriods) && !is_idle) { in Tick()
83 int ticker = identity->ticker.load(std::memory_order_relaxed); in ABSL_INTERNAL_C_SYMBOL() local
84 identity->wait_start.store(ticker ? ticker : 1, std::memory_order_relaxed); in ABSL_INTERNAL_C_SYMBOL()
/external/abseil-cpp/absl/synchronization/internal/
Dper_thread_sem.cc45 identity->ticker.store(0, std::memory_order_relaxed); in Init()
55 const int ticker = in Tick() local
56 identity->ticker.fetch_add(1, std::memory_order_relaxed) + 1; in Tick()
59 if (wait_start && (ticker - wait_start > Waiter::kIdlePeriods) && !is_idle) { in Tick()
83 int ticker = identity->ticker.load(std::memory_order_relaxed); in AbslInternalPerThreadSemWait() local
84 identity->wait_start.store(ticker ? ticker : 1, std::memory_order_relaxed); in AbslInternalPerThreadSemWait()
/external/grpc-grpc-java/netty/src/main/java/io/grpc/netty/
DMaxConnectionIdleManager.java39 private final Ticker ticker; field in MaxConnectionIdleManager
54 MaxConnectionIdleManager(long maxConnectionIdleInNanos, Ticker ticker) { in MaxConnectionIdleManager() argument
56 this.ticker = ticker; in MaxConnectionIdleManager()
67 nextIdleMonitorTime = ticker.nanoTime() + maxConnectionIdleInNanos; in start()
76 shutdownTask, nextIdleMonitorTime - ticker.nanoTime(), TimeUnit.NANOSECONDS); in start()
114 nextIdleMonitorTime = ticker.nanoTime() + maxConnectionIdleInNanos; in onTransportIdle()

1234