Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 320 for TimeUnit (0.35 seconds)

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

          Callable<T> callable, long timeoutDuration, TimeUnit timeoutUnit) throws ExecutionException {
        return callWithTimeout(callable, timeoutDuration, timeoutUnit);
      }
    
      @Override
      @SuppressWarnings("CatchingUnchecked") // sneaky checked exception
      public void runWithTimeout(Runnable runnable, long timeoutDuration, TimeUnit timeoutUnit) {
        checkNotNull(runnable);
        checkNotNull(timeoutUnit);
        try {
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Sun Dec 22 03:38:46 GMT 2024
    - 3.6K bytes
    - Click Count (0)
  2. okhttp-testing-support/src/main/kotlin/okhttp3/TestValueFactory.kt

      ): RealConnectionPool =
        RealConnectionPool(
          taskRunner = taskRunner,
          maxIdleConnections = maxIdleConnections,
          keepAliveDuration = 100L,
          timeUnit = TimeUnit.NANOSECONDS,
          connectionListener = ConnectionListener.NONE,
        )
    
      /** Returns an address that's without an SSL socket factory or hostname verifier.  */
      fun newAddress(
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Oct 08 03:50:05 GMT 2025
    - 6.7K bytes
    - Click Count (0)
  3. samples/guide/src/main/java/okhttp3/recipes/CancelCall.java

     * limitations under the License.
     */
    package okhttp3.recipes;
    
    import java.io.IOException;
    import java.util.concurrent.Executors;
    import java.util.concurrent.ScheduledExecutorService;
    import java.util.concurrent.TimeUnit;
    import okhttp3.Call;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    
    public class CancelCall {
      private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.1K bytes
    - Click Count (0)
  4. guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java

    import static com.google.common.base.Preconditions.checkNotNull;
    import static java.util.concurrent.TimeUnit.MILLISECONDS;
    import static java.util.concurrent.TimeUnit.NANOSECONDS;
    import static junit.framework.Assert.fail;
    
    import com.google.common.testing.TearDown;
    import com.google.common.testing.TearDownAccepter;
    import java.util.concurrent.TimeUnit;
    import java.util.logging.Logger;
    import org.jspecify.annotations.NullUnmarked;
    
    /**
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Sun Aug 10 19:54:19 GMT 2025
    - 4.5K bytes
    - Click Count (0)
  5. okhttp-testing-support/src/main/kotlin/okhttp3/internal/duplex/MockSocketHandler.kt

        }
      }
    
      /** Returns once all stream actions complete successfully. */
      fun awaitSuccess() {
        val futureTask =
          results.poll(5, TimeUnit.SECONDS)
            ?: throw AssertionError("no onRequest call received")
        futureTask.get(5, TimeUnit.SECONDS)
      }
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Thu Jul 31 04:18:40 GMT 2025
    - 3.3K bytes
    - Click Count (0)
  6. android/guava-testlib/src/com/google/common/util/concurrent/testing/TestingExecutors.java

          return shutdown;
        }
    
        @Override
        public boolean awaitTermination(long timeout, TimeUnit unit) {
          return true;
        }
    
        @Override
        public void execute(Runnable runnable) {}
    
        @Override
        public <V> ListenableScheduledFuture<V> schedule(
            Callable<V> callable, long delay, TimeUnit unit) {
          return NeverScheduledFuture.create();
        }
    
        @Override
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Jul 17 15:26:41 GMT 2025
    - 6.6K bytes
    - Click Count (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/TestLogHandler.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3
    
    import java.util.concurrent.LinkedBlockingQueue
    import java.util.concurrent.TimeUnit
    import java.util.logging.Handler
    import java.util.logging.Level
    import java.util.logging.LogRecord
    import java.util.logging.Logger
    import org.junit.jupiter.api.extension.AfterEachCallback
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 2.5K bytes
    - Click Count (0)
  8. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

        val elapsedMillis = TimeUnit.NANOSECONDS.toMillis(elapsedNanos)
        assertThat(elapsedMillis).isBetween(500L, 1000L)
      }
    
      /** Delay the response body by sleeping 1s.  */
      @Test
      fun delayResponse() {
        assumeNotWindows()
        server.enqueue(
          MockResponse
            .Builder()
            .body("ABCDEF")
            .bodyDelay(1, TimeUnit.SECONDS)
            .build(),
        )
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sun Aug 03 22:38:00 GMT 2025
    - 28K bytes
    - Click Count (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/AutobahnTester.kt

            ) {
              t.printStackTrace(System.out)
              latch.countDown()
            }
          },
        )
    
        check(latch.await(30, TimeUnit.SECONDS)) { "Timed out waiting for test $number to finish." }
        val endNanos = System.nanoTime()
        val tookMs = TimeUnit.NANOSECONDS.toMillis(endNanos - startNanos.get())
        println("Took ${tookMs}ms")
      }
    
      private fun getTestCount(): Long {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 4.6K bytes
    - Click Count (0)
  10. android/guava/src/com/google/common/util/concurrent/ForwardingExecutorService.java

    import java.util.List;
    import java.util.concurrent.Callable;
    import java.util.concurrent.ExecutionException;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Future;
    import java.util.concurrent.TimeUnit;
    import java.util.concurrent.TimeoutException;
    import org.jspecify.annotations.Nullable;
    
    /**
     * An executor service which forwards all its method calls to another executor service. Subclasses
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Sun Dec 22 03:38:46 GMT 2024
    - 4.1K bytes
    - Click Count (0)
Back to Top