/external/guava/guava-gwt/test-super/com/google/common/base/super/com/google/common/base/ |
D | StopwatchTest.java | 21 import static java.util.concurrent.TimeUnit.NANOSECONDS; 47 assertEquals(0, unstartedStopwatch.elapsed(NANOSECONDS)); in testCreateUnstarted() 52 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testInitialState() 101 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testReset_new() 104 assertEquals(3, stopwatch.elapsed(NANOSECONDS)); in testReset_new() 110 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testReset_whileRunning() 112 assertEquals(2, stopwatch.elapsed(NANOSECONDS)); in testReset_whileRunning() 116 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testReset_whileRunning() 122 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testElapsed_whileRunning() 125 assertEquals(345, stopwatch.elapsed(NANOSECONDS)); in testElapsed_whileRunning() [all …]
|
/external/guava/guava/src/com/google/common/base/ |
D | Stopwatch.java | 26 import static java.util.concurrent.TimeUnit.NANOSECONDS; 208 return desiredUnit.convert(elapsedNanos(), NANOSECONDS); in elapsed() 219 double value = (double) nanos / NANOSECONDS.convert(1, unit); in toString() 226 if (DAYS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 229 if (HOURS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 232 if (MINUTES.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 235 if (SECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 238 if (MILLISECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 241 if (MICROSECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 244 return NANOSECONDS; in chooseUnit() [all …]
|
/external/guava/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/ |
D | Stopwatch.java | 26 import static java.util.concurrent.TimeUnit.NANOSECONDS; 207 return desiredUnit.convert(elapsedNanos(), NANOSECONDS); in elapsed() 211 if (DAYS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 214 if (HOURS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 217 if (MINUTES.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 220 if (SECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 223 if (MILLISECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 226 if (MICROSECONDS.convert(nanos, NANOSECONDS) > 0) { in chooseUnit() 229 return NANOSECONDS; in chooseUnit() 234 case NANOSECONDS: in abbreviate()
|
/external/guava/guava-tests/test/com/google/common/base/ |
D | StopwatchTest.java | 21 import static java.util.concurrent.TimeUnit.NANOSECONDS; 48 assertEquals(0, unstartedStopwatch.elapsed(NANOSECONDS)); in testCreateUnstarted() 53 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testInitialState() 102 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testReset_new() 105 assertEquals(3, stopwatch.elapsed(NANOSECONDS)); in testReset_new() 111 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testReset_whileRunning() 113 assertEquals(2, stopwatch.elapsed(NANOSECONDS)); in testReset_whileRunning() 117 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testReset_whileRunning() 123 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testElapsed_whileRunning() 126 assertEquals(345, stopwatch.elapsed(NANOSECONDS)); in testElapsed_whileRunning() [all …]
|
/external/caliper/caliper/src/test/java/com/google/caliper/worker/ |
D | RuntimeWorkerTest.java | 21 import static java.util.concurrent.TimeUnit.NANOSECONDS; 44 oneCycle.times(INITIAL_REPS).to(NANOSECONDS), TIMING_INTERVAL.to(NANOSECONDS), 0.0); in testCalculateTargetReps_tinyBenchmark() 51 calculateTargetReps(INITIAL_REPS, HOURS.toNanos(1), TIMING_INTERVAL.to(NANOSECONDS), 0.0); in testCalculateTargetReps_hugeBenchmark() 57 TIMING_INTERVAL.to(NANOSECONDS), 0.5); in testCalculateTargetReps_applyRandomness()
|
/external/guava/guava/src/com/google/common/util/concurrent/ |
D | Uninterruptibles.java | 19 import static java.util.concurrent.TimeUnit.NANOSECONDS; 85 return latch.await(remainingNanos, NANOSECONDS); in awaitUninterruptibly() 173 return future.get(remainingNanos, NANOSECONDS); in getUninterruptibly() 201 NANOSECONDS.timedJoin(toJoin, remainingNanos); in joinUninterruptibly() 275 NANOSECONDS.sleep(remainingNanos); in sleepUninterruptibly() 316 return semaphore.tryAcquire(permits, remainingNanos, NANOSECONDS); in tryAcquireUninterruptibly()
|
/external/guava/guava-gwt/test-super/com/google/common/testing/super/com/google/common/testing/ |
D | FakeTickerTest.java | 45 assertSame(ticker, ticker.setAutoIncrementStep(10, TimeUnit.NANOSECONDS)); in testAutoIncrementStep_returnsSameInstance() 49 FakeTicker ticker = new FakeTicker().setAutoIncrementStep(10, TimeUnit.NANOSECONDS); in testAutoIncrementStep_nanos() 70 FakeTicker ticker = new FakeTicker().setAutoIncrementStep(10, TimeUnit.NANOSECONDS); in testAutoIncrementStep_resetToZero() 86 ticker.setAutoIncrementStep(-1, TimeUnit.NANOSECONDS); in testAutoIncrement_negative()
|
/external/guava/guava-testlib/test/com/google/common/testing/ |
D | FakeTickerTest.java | 56 assertSame(ticker, ticker.setAutoIncrementStep(10, TimeUnit.NANOSECONDS)); in testAutoIncrementStep_returnsSameInstance() 60 FakeTicker ticker = new FakeTicker().setAutoIncrementStep(10, TimeUnit.NANOSECONDS); in testAutoIncrementStep_nanos() 81 FakeTicker ticker = new FakeTicker().setAutoIncrementStep(10, TimeUnit.NANOSECONDS); in testAutoIncrementStep_resetToZero() 97 ticker.setAutoIncrementStep(-1, TimeUnit.NANOSECONDS); in testAutoIncrement_negative() 129 new FakeTicker().setAutoIncrementStep(incrementByNanos, TimeUnit.NANOSECONDS); in testConcurrentAutoIncrementStep()
|
/external/guava/guava-gwt/test-super/com/google/common/cache/super/com/google/common/cache/ |
D | CacheBuilderTest.java | 23 import static java.util.concurrent.TimeUnit.NANOSECONDS; 120 .expireAfterWrite(1, NANOSECONDS) in testTimeToLive_small() 145 .expireAfterAccess(1, NANOSECONDS) in testTimeToIdle_small() 162 .expireAfterWrite(1, NANOSECONDS) in testTimeToIdleAndToLive() 163 .expireAfterAccess(1, NANOSECONDS) in testTimeToIdleAndToLive()
|
/external/caliper/caliper/src/main/java/com/google/caliper/runner/ |
D | TrialRunLoop.java | 18 import static java.util.concurrent.TimeUnit.NANOSECONDS; 94 timeLimitNanos - trialStopwatch.elapsed(NANOSECONDS), in call() 95 NANOSECONDS); in call() 125 timeLimitNanos = trialStopwatch.elapsed(NANOSECONDS) + cleanupTimeNanos; in call() 197 return timeLimit.to(NANOSECONDS); in getTrialTimeLimitTrialNanos()
|
D | RuntimeInstrument.java | 28 import static java.util.concurrent.TimeUnit.NANOSECONDS; 199 ShortDuration.valueOf(options.get(optionName)).to(NANOSECONDS)); in toNanosString() 314 ShortDuration.of(BigDecimal.valueOf(measurement.value().magnitude()), NANOSECONDS)); in visit() 408 if (!notifiedAboutGranularity && ((nanos / 1000) > nanoTimeGranularity.to(NANOSECONDS))) { in validateMeasurement() 457 if ((nanos / 1000) < nanoTimeGranularity.to(NANOSECONDS)) { in validateMeasurement() 458 ShortDuration runtime = ShortDuration.of(BigDecimal.valueOf(nanos), NANOSECONDS); in validateMeasurement()
|
D | NanoTimeGranularityTester.java | 20 import static java.util.concurrent.TimeUnit.NANOSECONDS; 56 return ShortDuration.of(LongMath.divide(total, TRIALS * 8, CEILING), NANOSECONDS); in testNanoTimeGranularity()
|
/external/guava/guava-tests/test/com/google/common/collect/ |
D | QueuesTest.java | 94 int elements = drain(q, buf, 100, Long.MAX_VALUE, TimeUnit.NANOSECONDS, interruptibly); in testMultipleProducers() 163 int elements = Queues.drain(q, buf, -1, Long.MAX_VALUE, TimeUnit.NANOSECONDS); in testNegativeMaxElements() 169 Queues.drain(q, buf, 1, Long.MAX_VALUE, TimeUnit.NANOSECONDS); in testNegativeMaxElements() 181 Queues.drain(q, ImmutableList.of(), 100, Long.MAX_VALUE, TimeUnit.NANOSECONDS); in testDrain_throws() 204 Queues.drainUninterruptibly(q, buf, 100, Long.MAX_VALUE, TimeUnit.NANOSECONDS); in testDrainUninterruptibly_doesNotThrow() 254 Queues.drain(q, Lists.newArrayList(), 1, Long.MAX_VALUE, TimeUnit.NANOSECONDS); in assertInterruptibleDrained()
|
/external/guava/guava-tests/test/com/google/common/util/concurrent/ |
D | RateLimiterTest.java | 22 import static java.util.concurrent.TimeUnit.NANOSECONDS; 161 RateLimiter.create(1.0, 1, NANOSECONDS); in testCreateWarmupParameterValidation() 162 RateLimiter.create(1.0, 0, NANOSECONDS); in testCreateWarmupParameterValidation() 165 RateLimiter.create(0.0, 1, NANOSECONDS); in testCreateWarmupParameterValidation() 171 RateLimiter.create(1.0, -1, NANOSECONDS); in testCreateWarmupParameterValidation() 427 return NANOSECONDS.toMillis(stopwatch.instant - startTime); in measureTotalTimeMillis() 445 return NANOSECONDS.toMicros(instant); in readMicros()
|
D | MoreExecutorsTest.java | 39 import static java.util.concurrent.TimeUnit.NANOSECONDS; 630 private static final long HALF_SECOND_NANOS = NANOSECONDS.convert(1L, SECONDS) / 2; 640 when(service.awaitTermination(HALF_SECOND_NANOS, NANOSECONDS)).thenReturn(true); in testShutdownAndAwaitTermination_immediateShutdownInternal() 644 verify(service).awaitTermination(HALF_SECOND_NANOS, NANOSECONDS); in testShutdownAndAwaitTermination_immediateShutdownInternal() 649 when(service.awaitTermination(HALF_SECOND_NANOS, NANOSECONDS)) in testShutdownAndAwaitTermination_forcedShutDownInternal() 654 verify(service, times(2)).awaitTermination(HALF_SECOND_NANOS, NANOSECONDS); in testShutdownAndAwaitTermination_forcedShutDownInternal() 660 when(service.awaitTermination(HALF_SECOND_NANOS, NANOSECONDS)) in testShutdownAndAwaitTermination_nonTerminationInternal() 664 verify(service, times(2)).awaitTermination(HALF_SECOND_NANOS, NANOSECONDS); in testShutdownAndAwaitTermination_nonTerminationInternal() 670 when(service.awaitTermination(HALF_SECOND_NANOS, NANOSECONDS)) in testShutdownAndAwaitTermination_interruptedInternal() 688 verify(service).awaitTermination(HALF_SECOND_NANOS, NANOSECONDS); in testShutdownAndAwaitTermination_interruptedInternal()
|
D | InterruptionUtil.java | 21 import static java.util.concurrent.TimeUnit.NANOSECONDS; 129 NANOSECONDS.timedJoin(thread, remainingNanos); in joinUninterruptibly()
|
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/ |
D | RecordingCallback.java | 52 long timeoutMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) + TIMEOUT_MILLIS; in await() 62 long nowMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); in await()
|
D | OkHttpClientTest.java | 70 client.setConnectTimeout(1, TimeUnit.NANOSECONDS); in timeoutValidRange() 74 client.setWriteTimeout(1, TimeUnit.NANOSECONDS); in timeoutValidRange() 78 client.setReadTimeout(1, TimeUnit.NANOSECONDS); in timeoutValidRange()
|
/external/caliper/caliper/src/main/java/com/google/caliper/worker/ |
D | MacrobenchmarkWorker.java | 20 import static java.util.concurrent.TimeUnit.NANOSECONDS; 70 long nanos = stopwatch.stop().elapsed(NANOSECONDS); in measure()
|
D | RuntimeWorker.java | 19 import static java.util.concurrent.TimeUnit.NANOSECONDS; 118 ShortDuration.of(options.timingIntervalNanos, NANOSECONDS)); in invokeTimeMethod()
|
/external/guava/guava-testlib/src/com/google/common/util/concurrent/testing/ |
D | TestingExecutors.java | 162 return Longs.compare(getDelay(TimeUnit.NANOSECONDS), other.getDelay(TimeUnit.NANOSECONDS)); in compareTo()
|
/external/okhttp/mockwebserver/src/test/java/com/squareup/okhttp/mockwebserver/ |
D | MockWebServerTest.java | 40 import static java.util.concurrent.TimeUnit.NANOSECONDS; 207 long elapsedMillis = NANOSECONDS.toMillis(elapsedNanos); in throttleRequest() 233 long elapsedMillis = NANOSECONDS.toMillis(elapsedNanos); 250 long elapsedMillis = NANOSECONDS.toMillis(elapsedNanos);
|
/external/okhttp/okio/okio/src/test/java/okio/ |
D | SocketTimeoutTest.java | 83 assertTrue("elapsed: " + elapsed, TimeUnit.NANOSECONDS.toMillis(elapsed) >= 500); in writeWithTimeout() 84 assertTrue("elapsed: " + elapsed, TimeUnit.NANOSECONDS.toMillis(elapsed) <= 750); in writeWithTimeout()
|
/external/guava/guava-tests/test/com/google/common/cache/ |
D | CacheBuilderTest.java | 25 import static java.util.concurrent.TimeUnit.NANOSECONDS; 276 .expireAfterWrite(1, NANOSECONDS) in testTimeToLive_small() 301 .expireAfterAccess(1, NANOSECONDS) in testTimeToIdle_small() 318 .expireAfterWrite(1, NANOSECONDS) in testTimeToIdleAndToLive() 319 .expireAfterAccess(1, NANOSECONDS) in testTimeToIdleAndToLive()
|
/external/caliper/caliper/src/main/java/com/google/caliper/util/ |
D | ShortDuration.java | 54 long nanos = TimeUnit.NANOSECONDS.convert(duration, unit); in of() 268 TimeUnit bestUnit = TimeUnit.NANOSECONDS; in toString() 294 builder.putAll(TimeUnit.NANOSECONDS, "ns", "nanos"); in createAbbreviations()
|