Interface Clock

  • All Known Implementing Classes:
    Clock.Default

    public interface Clock
    Wrapper around time related functions that are either implemented by using the default JVM calls or by using a custom implementation for testing purposes. See Clock.Global.instance for how to use a custom implementation. Please note that Clock wasn't used, as it would not be possible to provide an implementation for nanoTime() with the exact same properties of System.nanoTime().
    • Method Detail

      • nanoTime

        long nanoTime()
        Semantically equivalent to System.nanoTime()
      • currentTimeMillis

        long currentTimeMillis()
        Semantically equivalent to System.currentTimeMillis()
      • nowInSeconds

        default long nowInSeconds()
      • waitUntil

        static void waitUntil​(long deadlineNanos)
                       throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException