Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 69 for nanoTime (0.18 sec)

  1. android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java

          this.unit = unit;
        }
    
        @Override
        public void run() {
          startTime = System.nanoTime();
          try {
            future.get(timeout, unit);
          } catch (Exception e) {
            // nothing
            exception = e;
          } finally {
            timeSpentBlocked = System.nanoTime() - startTime;
          }
        }
    
        void awaitWaiting() {
          while (!isBlocked()) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 46.8K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/-UtilJvm.kt

     * deadline if one exists already.
     */
    @Throws(IOException::class)
    internal fun Source.skipAll(
      duration: Int,
      timeUnit: TimeUnit,
    ): Boolean {
      val nowNs = System.nanoTime()
      val originalDurationNs =
        if (timeout().hasDeadline()) {
          timeout().deadlineNanoTime() - nowNs
        } else {
          Long.MAX_VALUE
        }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/util/concurrent/AbstractFuture.java

        Object localValue = value;
        if (localValue != null & !(localValue instanceof SetFuture)) {
          return getDoneValue(localValue);
        }
        // we delay calling nanoTime until we know we will need to either park or spin
        final long endNanos = remainingNanos > 0 ? System.nanoTime() + remainingNanos : 0;
        long_wait_loop:
        if (remainingNanos >= SPIN_THRESHOLD_NANOS) {
          Waiter oldHead = waiters;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 22 21:17:24 GMT 2024
    - 63K bytes
    - Viewed (0)
  4. guava/src/com/google/common/base/Suppliers.java

          // the extra memory consumption and indirection are more
          // expensive than the extra volatile reads.
          long nanos = expirationNanos;
          long now = System.nanoTime();
          if (nanos == 0 || now - nanos >= 0) {
            synchronized (this) {
              if (nanos == expirationNanos) { // recheck for lost race
                T t = delegate.get();
                value = t;
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 15.3K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

        val index = calls.indexOfFirst { it.get() == this@RealCall }
        check(index != -1)
    
        calls.removeAt(index)
        this.connection = null
    
        if (calls.isEmpty()) {
          connection.idleAtNs = System.nanoTime()
          if (connectionPool.connectionBecameIdle(connection)) {
            return connection.socket()
          }
        }
    
        return null
      }
    
      private fun <E : IOException?> timeoutExit(cause: E): E {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 17.9K bytes
    - Viewed (2)
  6. android/guava/src/com/google/common/base/Suppliers.java

          // the extra memory consumption and indirection are more
          // expensive than the extra volatile reads.
          long nanos = expirationNanos;
          long now = System.nanoTime();
          if (nanos == 0 || now - nanos >= 0) {
            synchronized (this) {
              if (nanos == expirationNanos) { // recheck for lost race
                T t = delegate.get();
                value = t;
    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)
  7. okhttp/src/test/java/okhttp3/CallTest.kt

        // The second byte of this request will be delayed by 750ms so we should time out after 250ms.
        val startNanos = System.nanoTime()
        bodySource.use {
          assertFailsWith<IOException> {
            bodySource.readByte()
          }.also { expected ->
            // Timed out as expected.
            val elapsedNanos = System.nanoTime() - startNanos
            val elapsedMillis = TimeUnit.NANOSECONDS.toMillis(elapsedNanos)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Connection.kt

      internal fun sendDegradedPingLater() {
        this.withLock {
          if (degradedPongsReceived < degradedPingsSent) return // Already awaiting a degraded pong.
          degradedPingsSent++
          degradedPongDeadlineNs = System.nanoTime() + DEGRADED_PONG_TIMEOUT_NS
        }
        writerQueue.execute("$connectionName ping") {
          writePing(false, DEGRADED_PING, 0)
        }
      }
    
      class Builder(
    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)
  9. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

        val call = client.newCall(Request(server.url("/")))
        val executeAtNanos = System.nanoTime()
        assertFailsWith<StreamResetException> {
          call.execute()
        }.also { expected ->
          assertThat(expected.message).isEqualTo(
            "stream was reset: PROTOCOL_ERROR",
          )
        }
        val elapsedUntilFailure = System.nanoTime() - executeAtNanos
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/cache/CacheBuilder.java

      long getRefreshNanos() {
        return (refreshNanos == UNSET_INT) ? DEFAULT_REFRESH_NANOS : refreshNanos;
      }
    
      /**
       * Specifies a nanosecond-precision time source for this cache. By default, {@link
       * System#nanoTime} is used.
       *
       * <p>The primary intent of this method is to facilitate testing of caches with a fake or mock
       * time source.
       *
       * @return this {@code CacheBuilder} instance (for chaining)
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 44.8K bytes
    - Viewed (0)
Back to top