- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 949 for second (0.06 sec)
-
internal/cachevalue/cache_test.go
"testing" "time" ) func slowCaller(ctx context.Context) error { sl := time.NewTimer(time.Second) defer sl.Stop() select { case <-sl.C: case <-ctx.Done(): return ctx.Err() } return nil } func TestCacheCtx(t *testing.T) { cache := New[time.Time]() t.Parallel() cache.InitOnce(2*time.Second, Opts{}, func(ctx context.Context) (time.Time, error) { return time.Now(), slowCaller(ctx) },
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu May 09 00:51:34 UTC 2024 - 2.7K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/CancelCall.java
Request request = new Request.Builder() .url("http://httpbin.org/delay/2") // This URL is served with a 2 second delay. .build(); final long startNanos = System.nanoTime(); final Call call = client.newCall(request); // Schedule a job to cancel the call in 1 second. executor.schedule(() -> { System.out.printf("%.2f Canceling call.%n", (System.nanoTime() - startNanos) / 1e9f);
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 12 03:31:36 UTC 2019 - 2.1K bytes - Viewed (0) -
guava-tests/test/com/google/common/eventbus/ReentrantEventsTest.java
static final String FIRST = "one"; static final Double SECOND = 2.0d; final EventBus bus = new EventBus(); public void testNoReentrantEvents() { ReentrantEventsHater hater = new ReentrantEventsHater(); bus.register(hater); bus.post(FIRST); assertEquals( "ReentrantEventHater expected 2 events", Lists.<Object>newArrayList(FIRST, SECOND), hater.eventsReceived); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.5K bytes - Viewed (0) -
okhttp-sse/src/test/java/okhttp3/sse/internal/ServerSentEventIteratorTest.kt
""" |data: first event |id: 1 | |data: second event |id | |data: third event | | """.trimMargin(), ) assertThat(callbacks.remove()).isEqualTo(Event("1", null, "first event")) assertThat(callbacks.remove()).isEqualTo(Event(null, null, "second event")) assertThat(callbacks.remove()).isEqualTo(Event(null, null, "third event")) }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 6.4K bytes - Viewed (0) -
internal/config/dns/operator_dns.go
Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 3 * time.Second, KeepAlive: 5 * time.Second, }).DialContext, ResponseHeaderTimeout: 3 * time.Second, TLSHandshakeTimeout: 3 * time.Second, ExpectContinueTimeout: 3 * time.Second, TLSClientConfig: &tls.Config{ RootCAs: args.rootCAs, }, // Go net/http automatically unzip if content-type is
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Mar 06 16:56:10 UTC 2023 - 6.6K bytes - Viewed (0) -
cni/pkg/nodeagent/ztunnelserver_test.go
panic(err) } err = c.SetWriteDeadline(time.Now().Add(time.Second)) if err != nil { panic(err) } c.Write(data) } func sendHello(c *net.UnixConn) { ack := &zdsapi.ZdsHello{ Version: zdsapi.Version_V1, } data, err := proto.Marshal(ack) if err != nil { panic(err) } err = c.SetWriteDeadline(time.Now().Add(time.Second)) if err != nil { panic(err) } c.Write(data)
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Fri Apr 12 21:47:31 UTC 2024 - 8.6K bytes - Viewed (0) -
cmd/callhome.go
// sleep for some time and try again. duration := time.Duration(r.Float64() * float64(globalCallhomeConfig.FrequencyDur())) if duration < time.Second { // Make sure to sleep at least a second to avoid high CPU ticks. duration = time.Second } time.Sleep(duration) } }() } func runCallhome(ctx context.Context, objAPI ObjectLayer) bool {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri May 17 16:53:34 UTC 2024 - 5.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java
assertTrue(limiter.tryAcquire(0, SECONDS)); assertFalse(limiter.tryAcquire(0, SECONDS)); assertFalse(limiter.tryAcquire(0, SECONDS)); stopwatch.sleepMillis(100); assertFalse(limiter.tryAcquire(0, SECONDS)); } public void testTryAcquire_someWaitAllowed() { RateLimiter limiter = RateLimiter.create(5.0, stopwatch); assertTrue(limiter.tryAcquire(0, SECONDS));
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Oct 21 14:28:19 UTC 2024 - 21.8K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java
assertTrue(limiter.tryAcquire(0, SECONDS)); assertFalse(limiter.tryAcquire(0, SECONDS)); assertFalse(limiter.tryAcquire(0, SECONDS)); stopwatch.sleepMillis(100); assertFalse(limiter.tryAcquire(0, SECONDS)); } public void testTryAcquire_someWaitAllowed() { RateLimiter limiter = RateLimiter.create(5.0, stopwatch); assertTrue(limiter.tryAcquire(0, SECONDS));
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Oct 21 14:28:19 UTC 2024 - 21.8K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/TreeMultimapExplicitTest.java
public int compare(@Nullable String first, @Nullable String second) { if (first == second) { return 0; } else if (first == null) { return -1; } else if (second == null) { return 1; } else if (first.length() != second.length()) { return first.length() - second.length(); } else { return first.compareTo(second); } } }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:05:46 UTC 2024 - 8.4K bytes - Viewed (0)