Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 190 for nanotime (0.14 sec)

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

      @SuppressWarnings("removal") // b/260137033
      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);
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 17:40:56 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  2. src/runtime/os_linux_arm.go

    	case _AT_PLATFORM:
    		cpu.Platform = gostringnocopy((*byte)(unsafe.Pointer(val)))
    	}
    }
    
    func osArchInit() {}
    
    //go:nosplit
    func cputicks() int64 {
    	// nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
    	return nanotime()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  3. src/runtime/runtime.go

    // produces timestamps on such a coarse granularity that the error from this conversion is actually
    // preferable.)
    //
    // The strategy for computing the conversion rate is to write down nanotime and cputicks as
    // early in process startup as possible. From then, we just need to wait until we get values
    // from nanotime that we can use (some platforms have a really coarse system time granularity).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:47 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/base/Ticker.java

       *
       * @since 10.0
       */
      public static Ticker systemTicker() {
        return SYSTEM_TICKER;
      }
    
      private static final Ticker SYSTEM_TICKER =
          new Ticker() {
            @Override
            @SuppressWarnings("GoodTime") // reading system time without TimeSource
            public long read() {
              return System.nanoTime();
            }
          };
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 23 23:27:53 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  5. platforms/core-runtime/time/src/test/groovy/org/gradle/internal/time/DefaultTimerTest.groovy

    package org.gradle.internal.time
    
    import spock.lang.Specification
    
    import java.util.concurrent.TimeUnit
    
    class DefaultTimerTest extends Specification {
    
        def timeSource = Mock(TimeSource) {
            1 * nanoTime() >> 0
        }
    
        def timer = new DefaultTimer(timeSource)
    
        def testOnlySecondsTwoDigits() throws Exception {
            when:
            setTime(51243)
    
            then:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 11 20:20:17 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  6. docs/recipes.md

                .build()
    
            val startNanos = System.nanoTime()
            val 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)
              call.cancel()
              System.out.printf("%.2f Canceled call.%n", (System.nanoTime() - startNanos) / 1e9f)
            }, 1, TimeUnit.SECONDS)
    
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Fri Feb 18 08:52:22 UTC 2022
    - 40.2K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java

          long end = System.nanoTime() + remainingNanos;
    
          while (true) {
            try {
              // TimeUnit.timedJoin() treats negative timeouts just like zero.
              NANOSECONDS.timedJoin(thread, remainingNanos);
              return;
            } catch (InterruptedException e) {
              interrupted = true;
              remainingNanos = end - System.nanoTime();
            }
          }
        } finally {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 4.4K bytes
    - Viewed (0)
  8. guava/src/com/google/common/util/concurrent/DirectExecutorService.java

            if (shutdown && runningTasks == 0) {
              return true;
            } else if (nanos <= 0) {
              return false;
            } else {
              long now = System.nanoTime();
              TimeUnit.NANOSECONDS.timedWait(lock, nanos);
              nanos -= System.nanoTime() - now; // subtract the actual time we waited
            }
          }
        }
      }
    
      /**
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed May 15 10:40:05 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  9. src/runtime/lock_wasip1.go

    func notetsleepg(n *note, ns int64) bool {
    	gp := getg()
    	if gp == gp.m.g0 {
    		throw("notetsleepg on g0")
    	}
    
    	deadline := nanotime() + ns
    	for {
    		if n.key != 0 {
    			return true
    		}
    		if sched_yield() != 0 {
    			throw("sched_yield failed")
    		}
    		Gosched()
    		if ns >= 0 && nanotime() >= deadline {
    			return false
    		}
    	}
    }
    
    func beforeIdle(int64, int64) (*g, bool) {
    	return nil, false
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 21:02:20 UTC 2023
    - 2K bytes
    - Viewed (0)
  10. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/LoggingEventListener.kt

    class LoggingEventListener private constructor(
      private val logger: HttpLoggingInterceptor.Logger,
    ) : EventListener() {
      private var startNs: Long = 0
    
      override fun callStart(call: Call) {
        startNs = System.nanoTime()
    
        logWithTime("callStart: ${call.request()}")
      }
    
      override fun proxySelectStart(
        call: Call,
        url: HttpUrl,
      ) {
        logWithTime("proxySelectStart: $url")
      }
    
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Apr 01 11:07:32 UTC 2024
    - 5.4K bytes
    - Viewed (0)
Back to top