Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for startInstant (0.15 sec)

  1. api/maven-api-core/src/main/java/org/apache/maven/api/MonotonicClock.java

        private final long startNanos;
        private final Instant startInstant;
    
        /**
         * Private constructor to enforce singleton pattern.
         * Initializes the clock with the current system time and nanoTime.
         */
        private MonotonicClock() {
            this.startNanos = System.nanoTime();
            this.startInstant = Clock.systemUTC().instant();
        }
    
        /**
    Registered: Sun Sep 07 03:35:12 UTC 2025
    - Last Modified: Wed Jan 15 06:28:29 UTC 2025
    - 5.6K bytes
    - Viewed (0)
  2. api/maven-api-core/src/test/java/org/apache/maven/api/MonotonicClockTest.java

                MonotonicClock clock = MonotonicClock.get();
                Instant now = clock.instant();
                Duration elapsed = clock.elapsedTime();
                Duration calculated = Duration.between(clock.startInstant(), now);
    
                // Allow for small timing differences (1ms) due to execution time between measurements
                assertTrue(
                        Math.abs(elapsed.toMillis() - calculated.toMillis()) <= 1,
    Registered: Sun Sep 07 03:35:12 UTC 2025
    - Last Modified: Wed Jan 15 06:28:29 UTC 2025
    - 5.8K bytes
    - Viewed (0)
Back to top