Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 37 for elapsed (0.19 sec)

  1. android/guava-tests/test/com/google/common/base/StopwatchTest.java

        ticker.advance(2);
        assertEquals(0, stopwatch.elapsed(NANOSECONDS));
        stopwatch.start();
        ticker.advance(3);
        assertEquals(3, stopwatch.elapsed(NANOSECONDS));
      }
    
      public void testReset_whileRunning() {
        ticker.advance(1);
        stopwatch.start();
        assertEquals(0, stopwatch.elapsed(NANOSECONDS));
        ticker.advance(2);
        assertEquals(2, stopwatch.elapsed(NANOSECONDS));
        stopwatch.reset();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/base/StopwatchTest.java

        ticker.advance(2);
        assertEquals(0, stopwatch.elapsed(NANOSECONDS));
        stopwatch.start();
        ticker.advance(3);
        assertEquals(3, stopwatch.elapsed(NANOSECONDS));
      }
    
      public void testReset_whileRunning() {
        ticker.advance(1);
        stopwatch.start();
        assertEquals(0, stopwatch.elapsed(NANOSECONDS));
        ticker.advance(2);
        assertEquals(2, stopwatch.elapsed(NANOSECONDS));
        stopwatch.reset();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  3. guava/src/com/google/common/base/Stopwatch.java

       * #elapsed(TimeUnit)}, this method does not lose any precision due to rounding.
       *
       * @since 22.0
       */
      @J2ktIncompatible
      @GwtIncompatible
      @J2ObjCIncompatible
      public Duration elapsed() {
        return Duration.ofNanos(elapsedNanos());
      }
    
      /** Returns a string representation of the current elapsed time. */
      @Override
    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)
  4. android/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

        Stopwatch stopwatch = Stopwatch.createStarted();
    
        String result = proxy.sleepThenReturnInput("x");
    
        assertThat(result).isEqualTo("x");
        assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS));
        assertThat(target.finished).isTrue();
      }
    
      public void testNewProxy_goodMethodWithNotEnoughTime() throws Exception {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.5K bytes
    - Viewed (0)
  5. guava/src/com/google/common/base/Ticker.java

    /**
     * A time source; returns a time value representing the number of nanoseconds elapsed since some
     * fixed but arbitrary point in time. Note that most users should use {@link Stopwatch} instead of
     * interacting with this class directly.
     *
     * <p><b>Warning:</b> this interface can only be used to measure elapsed time, not wall time.
     *
     * @author Kevin Bourrillion
    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)
  6. android/guava-tests/test/com/google/common/collect/QueuesTest.java

          Stopwatch timer = Stopwatch.createStarted();
    
          int drained = drain(q, newArrayList(), 2, 10, MILLISECONDS, interruptibly);
          assertThat(drained).isAtMost(1);
    
          assertThat(timer.elapsed(MILLISECONDS)).isAtLeast(10L);
    
          // If even the first one wasn't there, clean up so that the next test doesn't see an element.
          producerThread.cancel(true);
          producer.doneProducing.await();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

        Stopwatch stopwatch = Stopwatch.createStarted();
    
        String result = proxy.sleepThenReturnInput("x");
    
        assertThat(result).isEqualTo("x");
        assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS));
        assertThat(target.finished).isTrue();
      }
    
      public void testNewProxy_goodMethodWithNotEnoughTime() throws Exception {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.5K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/base/Ticker.java

    /**
     * A time source; returns a time value representing the number of nanoseconds elapsed since some
     * fixed but arbitrary point in time. Note that most users should use {@link Stopwatch} instead of
     * interacting with this class directly.
     *
     * <p><b>Warning:</b> this interface can only be used to measure elapsed time, not wall time.
     *
     * @author Kevin Bourrillion
    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)
  9. android/guava/src/com/google/common/base/Stopwatch.java

       *
       * @since 14.0 (since 10.0 as {@code elapsedTime()})
       */
      public long elapsed(TimeUnit desiredUnit) {
        return desiredUnit.convert(elapsedNanos(), NANOSECONDS);
      }
    
      /** Returns a string representation of the current elapsed time. */
      @Override
      public String toString() {
        long nanos = elapsedNanos();
    
        TimeUnit unit = chooseUnit(nanos);
    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)
  10. android/guava/src/com/google/common/util/concurrent/TimeoutFuture.java

            timeoutFuture.setFuture(delegate);
          } else {
            try {
              ScheduledFuture<?> timer = timeoutFuture.timer;
              timeoutFuture.timer = null; // Don't include already elapsed delay in delegate.toString()
              String message = "Timed out";
              // This try-finally block ensures that we complete the timeout future, even if attempting
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 01 21:46:34 GMT 2024
    - 7.7K bytes
    - Viewed (0)
Back to top