Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 12 for toNanos (0.06 seconds)

  1. okhttp/src/jvmTest/kotlin/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")
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Fri Dec 27 13:39:56 GMT 2024
    - 3.5K bytes
    - Click Count (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) {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Apr 14 15:16:19 GMT 2025
    - 4.1K bytes
    - Click Count (0)
  3. 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) {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Apr 14 15:16:19 GMT 2025
    - 3.4K bytes
    - Click Count (0)
  4. guava/src/com/google/common/collect/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() {}
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Nov 04 17:24:58 GMT 2025
    - 1.7K bytes
    - Click Count (0)
  5. 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)
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 7.5K bytes
    - Click Count (0)
  6. 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() {}
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Apr 14 15:16:19 GMT 2025
    - 1.9K bytes
    - Click Count (0)
  7. android/guava/src/com/google/common/util/concurrent/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() {}
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Apr 14 16:07:06 GMT 2025
    - 1.8K bytes
    - Click Count (0)
  8. android/guava/src/com/google/common/collect/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() {}
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Nov 04 17:24:58 GMT 2025
    - 1.8K bytes
    - Click Count (0)
  9. 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() {}
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Apr 14 15:16:19 GMT 2025
    - 1.9K bytes
    - Click Count (0)
  10. android/guava/src/com/google/common/util/concurrent/DirectExecutorService.java

        synchronized (lock) {
          return shutdown && runningTasks == 0;
        }
      }
    
      @Override
      public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
        long nanos = unit.toNanos(timeout);
        synchronized (lock) {
          while (true) {
            if (shutdown && runningTasks == 0) {
              return true;
            } else if (nanos <= 0) {
              return false;
            } else {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Dec 16 14:23:59 GMT 2025
    - 3.4K bytes
    - Click Count (0)
Back to Top