Interface ITimeSupplier

All Known Implementing Classes:
SystemTimeSupplier

public interface ITimeSupplier
An object providing a representation of the time. It is supposed to provide system current time in core functions and can be replaced by a "by hand increased" time abstraction in tests.
Author:
ActiveViam
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the current time with respect to the current instance.
    void
    sleep(long time)
    Waits for time to increase by a prescribed amount.
  • Method Details

    • currentTimeMillis

      long currentTimeMillis()
      Returns the current time with respect to the current instance.

      Warning: this clock can be non-monotonic.

      Returns:
      the current time in milliseconds
    • sleep

      void sleep(long time) throws InterruptedException
      Waits for time to increase by a prescribed amount.
      Parameters:
      time - amount of time to wait for in milliseconds
      Throws:
      InterruptedException - if any thread has interrupted the current thread