Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for nanoTime (0.19 sec)

  1. android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java

          long end = System.nanoTime() + remainingNanos;
    
          while (true) {
            try {
              // CountDownLatch treats negative timeouts just like zero.
              return latch.await(remainingNanos, NANOSECONDS);
            } catch (InterruptedException e) {
              interrupted = true;
              remainingNanos = end - System.nanoTime();
            }
          }
        } finally {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 14.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

        if (profileTests) runTestProfiled();
        else super.runTest();
      }
    
      protected void runTestProfiled() throws Throwable {
        long t0 = System.nanoTime();
        try {
          super.runTest();
        } finally {
          long elapsedMillis = (System.nanoTime() - t0) / (1000L * 1000L);
          if (elapsedMillis >= profileThreshold)
            System.out.printf("%n%s: %d%n", toString(), elapsedMillis);
        }
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 37.7K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/base/Stopwatch.java

     * (by default) uses {@link System#nanoTime}, it is unaffected by these changes.
     *
     * <p>Use this class instead of direct calls to {@link System#nanoTime} for two reasons:
     *
     * <ul>
     *   <li>The raw {@code long} values returned by {@code nanoTime} are meaningless and unsafe to use
     *       in any other way than how {@code Stopwatch} uses them.
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Nov 15 21:38:09 GMT 2022
    - 8.5K bytes
    - Viewed (0)
  4. guava/src/com/google/common/base/Stopwatch.java

     * (by default) uses {@link System#nanoTime}, it is unaffected by these changes.
     *
     * <p>Use this class instead of direct calls to {@link System#nanoTime} for two reasons:
     *
     * <ul>
     *   <li>The raw {@code long} values returned by {@code nanoTime} are meaningless and unsafe to use
     *       in any other way than how {@code Stopwatch} uses them.
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 23 15:09:35 GMT 2023
    - 9.2K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/Monitor.java

       * - System.nanoTime() is expensive enough that we want to call it the minimum required number of
       *   times, typically once before invoking a blocking method. This often requires keeping track of
       *   the first time in a method that nanoTime() has been invoked, for which the special value 0L
       *   is reserved to mean "uninitialized". If timeout is non-positive, then nanoTime need never be
       *   called.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 18:22:01 GMT 2023
    - 38.6K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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 Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

        if (profileTests) runTestProfiled();
        else super.runTest();
      }
    
      protected void runTestProfiled() throws Throwable {
        long t0 = System.nanoTime();
        try {
          super.runTest();
        } finally {
          long elapsedMillis = (System.nanoTime() - t0) / (1000L * 1000L);
          if (elapsedMillis >= profileThreshold)
            System.out.printf("%n%s: %d%n", toString(), elapsedMillis);
        }
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 37.2K bytes
    - Viewed (0)
  10. guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java

        }
        return total;
      }
    
      @Benchmark
      long manual(int reps) {
        long total = 0;
        for (int i = 0; i < reps; i++) {
          long start = System.nanoTime();
          // here is where you would do something
          total += (System.nanoTime() - start);
        }
        return total;
      }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 1.5K bytes
    - Viewed (0)
Back to top