Class Clock.SystemClock

java.lang.Object
io.unitycatalog.client.internal.Clock.SystemClock
All Implemented Interfaces:
Clock
Enclosing interface:
Clock

public static class Clock.SystemClock extends Object implements Clock
  • Constructor Details

    • SystemClock

      public SystemClock()
  • Method Details

    • now

      public Instant now()
      Specified by:
      now in interface Clock
      Returns:
      the current time of the clock.
    • sleep

      public void sleep(Duration duration) throws InterruptedException
      Description copied from interface: Clock
      Sleeps for the given duration.

      For system clock, this performs an actual sleep by calling Thread.sleep(long). For manual clock, this advances the clock time by the given duration without sleeping.

      Specified by:
      sleep in interface Clock
      Parameters:
      duration - the duration to sleep
      Throws:
      InterruptedException - if the sleep is interrupted (only for system clock)