Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 44 for toNanos (0.18 sec)

  1. guava-testlib/src/com/google/common/testing/FakeTicker.java

      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
      @CanIgnoreReturnValue
      public FakeTicker advance(long time, TimeUnit timeUnit) {
        return advance(timeUnit.toNanos(time));
      }
    
      /** Advances the ticker value by {@code nanoseconds}. */
      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
      @CanIgnoreReturnValue
      public FakeTicker advance(long nanoseconds) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 14:40:46 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/testing/FakeTicker.java

      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
      @CanIgnoreReturnValue
      public FakeTicker advance(long time, TimeUnit timeUnit) {
        return advance(timeUnit.toNanos(time));
      }
    
      /** Advances the ticker value by {@code nanoseconds}. */
      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
      @CanIgnoreReturnValue
      public FakeTicker advance(long nanoseconds) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Mar 13 18:17:09 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java

      public static boolean awaitUninterruptibly(CountDownLatch latch, long timeout, TimeUnit unit) {
        boolean interrupted = false;
        try {
          long remainingNanos = unit.toNanos(timeout);
          long end = System.nanoTime() + remainingNanos;
    
          while (true) {
            try {
              // CountDownLatch treats negative timeouts just like zero.
    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)
  4. okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerRealBackendTest.kt

      @AfterEach fun tearDown() {
        backend.shutdown()
      }
    
      @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")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java

      private static void joinUninterruptibly(Thread thread, long timeout, TimeUnit unit) {
        boolean interrupted = false;
        try {
          long remainingNanos = unit.toNanos(timeout);
          long end = System.nanoTime() + remainingNanos;
    
          while (true) {
            try {
              // TimeUnit.timedJoin() treats negative timeouts just like zero.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
  6. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

          throttlePeriodNanos = unit.toNanos(period)
        }
    
        /**
         * Set the delayed time of the response body to [delay]. This applies to the response body
         * only; response headers are not affected.
         */
        fun bodyDelay(
          delay: Long,
          unit: TimeUnit,
        ) = apply {
          bodyDelayNanos = unit.toNanos(delay)
        }
    
        fun headersDelay(
          delay: Long,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 13.3K bytes
    - Viewed (1)
  7. guava-testlib/src/com/google/common/testing/GcFinalization.java

      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);
            return;
    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)
  8. android/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java

        }
    
        @Override
        public boolean equals(@Nullable Object o) {
          if (o instanceof DurationSpec) {
            DurationSpec that = (DurationSpec) o;
            return unit.toNanos(duration) == that.unit.toNanos(that.duration);
          }
          return false;
        }
    
        @Override
        public String toString() {
          return MoreObjects.toStringHelper(this)
              .add("duration", duration)
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  9. guava/src/com/google/common/base/Internal.java

        // Using a try/catch seems lazy, but the catch block will rarely get invoked (except for
        // durations longer than approximately +/- 292 years).
        try {
          return duration.toNanos();
        } catch (ArithmeticException tooBig) {
          return duration.isNegative() ? Long.MIN_VALUE : Long.MAX_VALUE;
        }
      }
    
      private Internal() {}
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Jan 11 14:30:06 GMT 2024
    - 2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/base/Internal.java

        // Using a try/catch seems lazy, but the catch block will rarely get invoked (except for
        // durations longer than approximately +/- 292 years).
        try {
          return duration.toNanos();
        } catch (ArithmeticException tooBig) {
          return duration.isNegative() ? Long.MIN_VALUE : Long.MAX_VALUE;
        }
      }
    
      private Internal() {}
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Jan 11 14:30:06 GMT 2024
    - 2K bytes
    - Viewed (0)
Back to top