Home
last modified time | relevance | path

Searched refs:stopwatch (Results 1 – 25 of 79) sorted by relevance

1234

/external/guava/android/guava-tests/test/com/google/common/base/
DStopwatchTest.java36 private final Stopwatch stopwatch = new Stopwatch(ticker); field in StopwatchTest
50 assertFalse(stopwatch.isRunning()); in testInitialState()
51 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testInitialState()
55 assertSame(stopwatch, stopwatch.start()); in testStart()
56 assertTrue(stopwatch.isRunning()); in testStart()
60 stopwatch.start(); in testStart_whileRunning()
62 stopwatch.start(); in testStart_whileRunning()
66 assertTrue(stopwatch.isRunning()); in testStart_whileRunning()
70 stopwatch.start(); in testStop()
71 assertSame(stopwatch, stopwatch.stop()); in testStop()
[all …]
/external/guava/guava-tests/test/com/google/common/base/
DStopwatchTest.java38 private final Stopwatch stopwatch = new Stopwatch(ticker); field in StopwatchTest
52 assertFalse(stopwatch.isRunning()); in testInitialState()
53 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testInitialState()
57 assertSame(stopwatch, stopwatch.start()); in testStart()
58 assertTrue(stopwatch.isRunning()); in testStart()
62 stopwatch.start(); in testStart_whileRunning()
64 stopwatch.start(); in testStart_whileRunning()
68 assertTrue(stopwatch.isRunning()); in testStart_whileRunning()
72 stopwatch.start(); in testStop()
73 assertSame(stopwatch, stopwatch.stop()); in testStop()
[all …]
/external/guava/android/guava-tests/test/com/google/common/util/concurrent/
DRateLimiterTest.java49 private final FakeStopwatch stopwatch = new FakeStopwatch(); field in RateLimiterTest
52 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimple()
66 RateLimiter r = RateLimiter.create(Double.MIN_VALUE, stopwatch); in testDoubleMinValueCanAcquireExactlyOnce()
69 stopwatch.sleepMillis(Integer.MAX_VALUE); in testDoubleMinValueCanAcquireExactlyOnce()
126 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleWithWait()
128 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleWithWait()
135 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleAcquireReturnValues()
137 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleAcquireReturnValues()
144 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleAcquireEarliestAvailableIsInPast()
146 stopwatch.sleepMillis(400); in testSimpleAcquireEarliestAvailableIsInPast()
[all …]
DUninterruptiblesTest.java105 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitTimeoutExceeded() local
111 assertAtLeastTimePassed(stopwatch, 500); in testConditionAwaitTimeoutExceeded()
116 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitTimeoutNotExceeded() local
122 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testConditionAwaitTimeoutNotExceeded()
127 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitInterruptedTimeoutExceeded() local
134 assertAtLeastTimePassed(stopwatch, 1000); in testConditionAwaitInterruptedTimeoutExceeded()
139 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitInterruptedTimeoutNotExceeded() local
146 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testConditionAwaitInterruptedTimeoutNotExceeded()
152 Stopwatch stopwatch = Stopwatch.createStarted(); in testTryLockTimeoutExceeded() local
159 assertAtLeastTimePassed(stopwatch, 500); in testTryLockTimeoutExceeded()
[all …]
DSimpleTimeLimiterTest.java98 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_goodMethodWithEnoughTime() local
103 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testNewProxy_goodMethodWithEnoughTime()
110 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_goodMethodWithNotEnoughTime() local
118 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(NOT_ENOUGH_MS, DELAY_MS * 2)); in testNewProxy_goodMethodWithNotEnoughTime()
128 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_badMethodWithEnoughTime() local
136 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testNewProxy_badMethodWithEnoughTime()
142 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_badMethodWithNotEnoughTime() local
150 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(NOT_ENOUGH_MS, DELAY_MS * 2)); in testNewProxy_badMethodWithNotEnoughTime()
154 Stopwatch stopwatch = Stopwatch.createStarted(); in testCallWithTimeout_goodCallableWithEnoughTime() local
159 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testCallWithTimeout_goodCallableWithEnoughTime()
[all …]
/external/guava/guava-tests/test/com/google/common/util/concurrent/
DRateLimiterTest.java49 private final FakeStopwatch stopwatch = new FakeStopwatch(); field in RateLimiterTest
52 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimple()
66 RateLimiter r = RateLimiter.create(Double.MIN_VALUE, stopwatch); in testDoubleMinValueCanAcquireExactlyOnce()
69 stopwatch.sleepMillis(Integer.MAX_VALUE); in testDoubleMinValueCanAcquireExactlyOnce()
126 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleWithWait()
128 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleWithWait()
135 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleAcquireReturnValues()
137 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleAcquireReturnValues()
144 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleAcquireEarliestAvailableIsInPast()
146 stopwatch.sleepMillis(400); in testSimpleAcquireEarliestAvailableIsInPast()
[all …]
DSimpleTimeLimiterTest.java98 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_goodMethodWithEnoughTime() local
103 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testNewProxy_goodMethodWithEnoughTime()
110 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_goodMethodWithNotEnoughTime() local
118 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(NOT_ENOUGH_MS, DELAY_MS * 2)); in testNewProxy_goodMethodWithNotEnoughTime()
128 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_badMethodWithEnoughTime() local
136 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testNewProxy_badMethodWithEnoughTime()
142 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_badMethodWithNotEnoughTime() local
150 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(NOT_ENOUGH_MS, DELAY_MS * 2)); in testNewProxy_badMethodWithNotEnoughTime()
154 Stopwatch stopwatch = Stopwatch.createStarted(); in testCallWithTimeout_goodCallableWithEnoughTime() local
159 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testCallWithTimeout_goodCallableWithEnoughTime()
[all …]
DUninterruptiblesTest.java106 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitTimeoutExceeded() local
112 assertAtLeastTimePassed(stopwatch, 500); in testConditionAwaitTimeoutExceeded()
117 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitTimeoutNotExceeded() local
123 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testConditionAwaitTimeoutNotExceeded()
128 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitInterruptedTimeoutExceeded() local
135 assertAtLeastTimePassed(stopwatch, 1000); in testConditionAwaitInterruptedTimeoutExceeded()
140 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitInterruptedTimeoutNotExceeded() local
147 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testConditionAwaitInterruptedTimeoutNotExceeded()
153 Stopwatch stopwatch = Stopwatch.createStarted(); in testTryLockTimeoutExceeded() local
160 assertAtLeastTimePassed(stopwatch, 500); in testTryLockTimeoutExceeded()
[all …]
/external/okio/okio/src/jvmTest/kotlin/okio/
DThrottlerTest.kt35 private var stopwatch = Stopwatch() variable in okio.ThrottlerTest
40 stopwatch = Stopwatch() in setup()
49 stopwatch.assertElapsed(0.25) in source()
54 stopwatch.assertElapsed(0.25) in sink()
59 stopwatch.assertElapsed(0.5) in doubleSourceThrottle()
64 stopwatch.assertElapsed(0.5) in doubleSinkThrottle()
69 stopwatch.assertElapsed(0.5) in singleSourceMultiThrottleSlowerThenSlow()
74 stopwatch.assertElapsed(0.5) in singleSourceMultiThrottleSlowThenSlower()
79 stopwatch.assertElapsed(0.5) in slowSourceSlowerSink()
84 stopwatch.assertElapsed(0.5) in slowSinkSlowerSource()
[all …]
/external/guava/android/guava/src/com/google/common/util/concurrent/
DRateLimiter.java131 static RateLimiter create(double permitsPerSecond, SleepingStopwatch stopwatch) { in create() argument
132 RateLimiter rateLimiter = new SmoothBursty(stopwatch, 1.0 /* maxBurstSeconds */); in create()
174 SleepingStopwatch stopwatch) { in create() argument
175 RateLimiter rateLimiter = new SmoothWarmingUp(stopwatch, warmupPeriod, unit, coldFactor); in create()
184 private final SleepingStopwatch stopwatch; field in RateLimiter
202 RateLimiter(SleepingStopwatch stopwatch) { in RateLimiter() argument
203 this.stopwatch = checkNotNull(stopwatch); in RateLimiter()
228 doSetRate(permitsPerSecond, stopwatch.readMicros()); in setRate()
274 stopwatch.sleepMicrosUninterruptibly(microsToWait); in acquire()
287 return reserveAndGetWaitLength(permits, stopwatch.readMicros()); in reserve()
[all …]
DSmoothRateLimiter.java216 SleepingStopwatch stopwatch, long warmupPeriod, TimeUnit timeUnit, double coldFactor) { in SmoothWarmingUp() argument
217 super(stopwatch); in SmoothWarmingUp()
280 SmoothBursty(SleepingStopwatch stopwatch, double maxBurstSeconds) { in SmoothBursty() argument
281 super(stopwatch); in SmoothBursty()
329 private SmoothRateLimiter(SleepingStopwatch stopwatch) { in SmoothRateLimiter() argument
330 super(stopwatch); in SmoothRateLimiter()
/external/guava/guava/src/com/google/common/util/concurrent/
DRateLimiter.java133 static RateLimiter create(double permitsPerSecond, SleepingStopwatch stopwatch) { in create() argument
134 RateLimiter rateLimiter = new SmoothBursty(stopwatch, 1.0 /* maxBurstSeconds */); in create()
204 SleepingStopwatch stopwatch) { in create() argument
205 RateLimiter rateLimiter = new SmoothWarmingUp(stopwatch, warmupPeriod, unit, coldFactor); in create()
214 private final SleepingStopwatch stopwatch; field in RateLimiter
232 RateLimiter(SleepingStopwatch stopwatch) { in RateLimiter() argument
233 this.stopwatch = checkNotNull(stopwatch); in RateLimiter()
258 doSetRate(permitsPerSecond, stopwatch.readMicros()); in setRate()
304 stopwatch.sleepMicrosUninterruptibly(microsToWait); in acquire()
317 return reserveAndGetWaitLength(permits, stopwatch.readMicros()); in reserve()
[all …]
DSmoothRateLimiter.java216 SleepingStopwatch stopwatch, long warmupPeriod, TimeUnit timeUnit, double coldFactor) { in SmoothWarmingUp() argument
217 super(stopwatch); in SmoothWarmingUp()
280 SmoothBursty(SleepingStopwatch stopwatch, double maxBurstSeconds) { in SmoothBursty() argument
281 super(stopwatch); in SmoothBursty()
329 private SmoothRateLimiter(SleepingStopwatch stopwatch) { in SmoothRateLimiter() argument
330 super(stopwatch); in SmoothRateLimiter()
/external/dagger2/java/dagger/producers/monitoring/
DTimingProducerMonitor.java31 private final Stopwatch stopwatch; field in TimingProducerMonitor
38 this.stopwatch = Stopwatch.createUnstarted(ticker); in TimingProducerMonitor()
45 stopwatch.start(); in methodStarting()
52 long durationNanos = stopwatch.elapsed(NANOSECONDS); in methodFinished()
58 long latencyNanos = stopwatch.elapsed(NANOSECONDS); in succeeded()
64 if (stopwatch.isRunning()) { in failed()
65 long latencyNanos = stopwatch.elapsed(NANOSECONDS); in failed()
/external/llvm-project/lldb/test/API/benchmarks/expression/
DTestRepeatedExprs.py39 print("lldb benchmark:", self.stopwatch)
41 print("gdb benchmark:", self.stopwatch)
73 self.stopwatch.reset()
75 with self.stopwatch:
89 self.lldb_avg = self.stopwatch.avg()
91 print("lldb expression benchmark:", str(self.stopwatch))
119 self.stopwatch.reset()
121 with self.stopwatch:
137 self.gdb_avg = self.stopwatch.avg()
139 print("gdb expression benchmark:", str(self.stopwatch))
/external/grpc-grpc/src/csharp/Grpc.IntegrationTesting/
DClientRunners.cs211 var stopwatch = new Stopwatch(); in RunUnary()
222 stopwatch.Restart(); in RunUnary()
224 stopwatch.Stop(); in RunUnary()
227 … threadLocalHistogram.Value.AddObservation(stopwatch.Elapsed.TotalSeconds * SecondsToNanos); in RunUnary()
237 var stopwatch = new Stopwatch(); in RunUnaryAsync()
241 stopwatch.Restart(); in RunUnaryAsync()
243 stopwatch.Stop(); in RunUnaryAsync()
246 … threadLocalHistogram.Value.AddObservation(stopwatch.Elapsed.TotalSeconds * SecondsToNanos); in RunUnaryAsync()
256 var stopwatch = new Stopwatch(); in RunStreamingPingPongAsync()
262 stopwatch.Restart(); in RunStreamingPingPongAsync()
[all …]
/external/guice/core/src/com/google/inject/internal/
DInternalInjectorCreator.java60 private final Stopwatch stopwatch = new Stopwatch(); field in InternalInjectorCreator
103 shells = shellBuilder.build(initializer, bindingData, stopwatch, errors); in build()
104 stopwatch.resetAndLog("Injector construction"); in build()
123 stopwatch.resetAndLog("Binding initialization"); in initializeStatically()
128 stopwatch.resetAndLog("Binding indexing"); in initializeStatically()
131 stopwatch.resetAndLog("Collecting injection requests"); in initializeStatically()
134 stopwatch.resetAndLog("Binding validation"); in initializeStatically()
137 stopwatch.resetAndLog("Static validation"); in initializeStatically()
140 stopwatch.resetAndLog("Instance member validation"); in initializeStatically()
146 stopwatch.resetAndLog("Provider verification"); in initializeStatically()
[all …]
DInjectorShell.java125 Stopwatch stopwatch, in build() argument
154 stopwatch.resetAndLog("Module execution"); in build()
160 stopwatch.resetAndLog("Interceptors creation"); in build()
170 stopwatch.resetAndLog("TypeListeners & ProvisionListener creation"); in build()
173 stopwatch.resetAndLog("Scopes creation"); in build()
176 stopwatch.resetAndLog("Converters creation"); in build()
187 stopwatch.resetAndLog("Binding creation"); in build()
190 stopwatch.resetAndLog("Module annotated method scanners creation"); in build()
199 injectorShells.addAll(builder.build(initializer, bindingData, stopwatch, errors)); in build()
201 stopwatch.resetAndLog("Private environment creation"); in build()
/external/llvm-project/lldb/test/API/benchmarks/turnaround/
DTestCompileRunToBreakpointTurnaround.py37 print("lldb turnaround benchmark:", self.stopwatch)
39 print("gdb turnaround benchmark:", self.stopwatch)
67 self.stopwatch.reset()
75 with self.stopwatch:
84 self.lldb_avg = self.stopwatch.avg()
110 self.stopwatch.reset()
118 with self.stopwatch:
129 self.gdb_avg = self.stopwatch.avg()
/external/grpc-grpc/src/csharp/Grpc.Core/Utils/
DBenchmarkUtil.cs46 var stopwatch = new Stopwatch(); in RunBenchmark()
47 stopwatch.Start(); in RunBenchmark()
52 stopwatch.Stop(); in RunBenchmark()
53 logger.Info("Elapsed time: {0}ms", stopwatch.ElapsedMilliseconds); in RunBenchmark()
54 …Info("Ops per second: {0}", (int)((double)benchmarkIterations * 1000 / stopwatch.ElapsedMilliseco… in RunBenchmark()
/external/grpc-grpc-java/core/src/main/java/io/grpc/internal/
DRescheduler.java37 private final Stopwatch stopwatch; field in Rescheduler
46 Stopwatch stopwatch) { in Rescheduler() argument
50 this.stopwatch = stopwatch; in Rescheduler()
51 stopwatch.start(); in Rescheduler()
114 return stopwatch.elapsed(TimeUnit.NANOSECONDS); in nanoTime()
DHttp2Ping.java48 private final Stopwatch stopwatch; field in Http2Ping
81 public Http2Ping(long data, Stopwatch stopwatch) { in Http2Ping() argument
83 this.stopwatch = stopwatch; in Http2Ping()
131 roundTripTimeNanos = this.roundTripTimeNanos = stopwatch.elapsed(TimeUnit.NANOSECONDS); in complete()
/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/
DFakeClockTest.java102 Stopwatch stopwatch = fakeClock.getStopwatchSupplier().get(); in testStopWatch() local
105 stopwatch.start(); in testStopWatch()
109 assertEquals(expectedElapsedNanos, stopwatch.elapsed(TimeUnit.NANOSECONDS)); in testStopWatch()
113 assertEquals(expectedElapsedNanos, stopwatch.elapsed(TimeUnit.NANOSECONDS)); in testStopWatch()
115 stopwatch.stop(); in testStopWatch()
118 assertEquals(expectedElapsedNanos, stopwatch.elapsed(TimeUnit.NANOSECONDS)); in testStopWatch()
120 stopwatch.reset(); in testStopWatch()
123 assertEquals(expectedElapsedNanos, stopwatch.elapsed(TimeUnit.NANOSECONDS)); in testStopWatch()
/external/caliper/caliper/src/main/java/com/google/caliper/worker/
DMacrobenchmarkWorker.java42 private final Stopwatch stopwatch; field in MacrobenchmarkWorker
50 this.stopwatch = Stopwatch.createUnstarted(ticker); in MacrobenchmarkWorker()
68 stopwatch.start(); in measure()
70 long nanos = stopwatch.stop().elapsed(NANOSECONDS); in measure()
71 stopwatch.reset(); in measure()
/external/grpc-grpc/src/csharp/Grpc.Microbenchmarks/
DPInvokeByteArrayBenchmark.cs52 var stopwatch = Stopwatch.StartNew(); in ThreadBody()
60 stopwatch.Stop(); in ThreadBody()
61 Console.WriteLine("Elapsed millis: " + stopwatch.ElapsedMilliseconds); in ThreadBody()

1234