Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 69 for nanoTime (0.18 sec)

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

          long end = System.nanoTime() + remainingNanos;
    
          while (true) {
            try {
              // TimeUnit.timedJoin() treats negative timeouts just like zero.
              NANOSECONDS.timedJoin(thread, remainingNanos);
              return;
            } catch (InterruptedException e) {
              interrupted = true;
              remainingNanos = end - System.nanoTime();
            }
          }
        } finally {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
  2. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

            .build(),
        )
        val startNanos = System.nanoTime()
        val connection = server.url("/").toUrl().openConnection()
        connection.doOutput = true
        connection.getOutputStream().write("ABCDEF".toByteArray(UTF_8))
        val inputStream = connection.getInputStream()
        assertThat(inputStream.read()).isEqualTo(-1)
        val elapsedNanos = System.nanoTime() - startNanos
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 23.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/base/Ticker.java

       *
       * @since 10.0
       */
      public static Ticker systemTicker() {
        return SYSTEM_TICKER;
      }
    
      private static final Ticker SYSTEM_TICKER =
          new Ticker() {
            @Override
            @SuppressWarnings("GoodTime") // reading system time without TimeSource
            public long read() {
              return System.nanoTime();
            }
          };
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue May 23 23:27:53 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerRealBackendTest.kt

      }
    
      @Test fun test() {
        val t1 = System.nanoTime() / 1e6
    
        val delays = mutableListOf(TimeUnit.MILLISECONDS.toNanos(1000), -1L)
        queue.schedule("task", TimeUnit.MILLISECONDS.toNanos(750)) {
          log.put("runOnce delays.size=${delays.size}")
          return@schedule delays.removeAt(0)
        }
    
        assertThat(log.take()).isEqualTo("runOnce delays.size=2")
        val t2 = System.nanoTime() / 1e6 - t1
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  5. android/guava-testlib/src/com/google/common/testing/GcFinalization.java

      @SuppressWarnings("removal") // b/260137033
      public static void awaitDone(Future<?> future) {
        if (future.isDone()) {
          return;
        }
        long timeoutSeconds = timeoutSeconds();
        long deadline = System.nanoTime() + SECONDS.toNanos(timeoutSeconds);
        do {
          System.runFinalization();
          if (future.isDone()) {
            return;
          }
          System.gc();
          try {
            future.get(1L, SECONDS);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskQueue.kt

      internal fun scheduleAndDecide(
        task: Task,
        delayNanos: Long,
        recurrence: Boolean,
      ): Boolean {
        task.initQueue(this)
    
        val now = taskRunner.backend.nanoTime()
        val executeNanoTime = now + delayNanos
    
        // If the task is already scheduled, take the earlier of the two times.
        val existingIndex = futureTasks.indexOf(task)
        if (existingIndex != -1) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/LoggingInterceptors.java

        @Override public Response intercept(Chain chain) throws IOException {
          long t1 = System.nanoTime();
          Request request = chain.request();
          logger.info(String.format("Sending request %s on %s%n%s",
              request.url(), chain.connection(), request.headers()));
          Response response = chain.proceed(request);
    
          long t2 = System.nanoTime();
          logger.info(String.format("Received response for %s in %.1fms%n%s",
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jan 01 15:55:32 GMT 2016
    - 2K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt

        assertThat(pool.connectionCount()).isEqualTo(1)
      }
    
      @Test fun connectionPreWarmingHttp2() {
        taskFaker.advanceUntil(System.nanoTime())
        val expireSooner = taskFaker.nanoTime + 1_000_000_000_000
        val expireLater = taskFaker.nanoTime + 2_000_000_000_000
    
        routePlanner.autoGeneratePlans = true
        val address = routePlanner.address
        val pool = routePlanner.pool
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 24 04:40:49 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java

          long end = System.nanoTime() + remainingNanos;
    
          while (true) {
            try {
              // TimeUnit.timedJoin() treats negative timeouts just like zero.
              NANOSECONDS.timedJoin(thread, remainingNanos);
              return;
            } catch (InterruptedException e) {
              interrupted = true;
              remainingNanos = end - System.nanoTime();
            }
          }
        } finally {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (1)
  10. guava/src/com/google/common/base/Ticker.java

       *
       * @since 10.0
       */
      public static Ticker systemTicker() {
        return SYSTEM_TICKER;
      }
    
      private static final Ticker SYSTEM_TICKER =
          new Ticker() {
            @Override
            @SuppressWarnings("GoodTime") // reading system time without TimeSource
            public long read() {
              return System.nanoTime();
            }
          };
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Tue May 23 23:27:53 GMT 2023
    - 1.8K bytes
    - Viewed (0)
Back to top