Interface Clock

All Known Subinterfaces:
EventClock<T>
All Known Implementing Classes:
ContextClock

public interface Clock
A clock abstraction used to track pass of time
  • Method Summary

    Modifier and Type
    Method
    Description
    default Date
    Get the creation date/time as regular Java Date instance
    default Duration
    Get the elapsed duration for this clock in the standard Java Duration
    Get the creation date/time as with time-zone information
    long
    The elapsed time since the creation of the clock
    long
    The point in time the clock was created
  • Method Details

    • elapsed

      long elapsed()
      The elapsed time since the creation of the clock
      Returns:
      The elapsed time, in milliseconds, since the creation of the exchange
    • getCreated

      long getCreated()
      The point in time the clock was created
      Returns:
      The point in time, in milliseconds, the exchange was created.
      See Also:
    • asZonedCreationDateTime

      default ZonedDateTime asZonedCreationDateTime()
      Get the creation date/time as with time-zone information
      Returns:
      A ZonedDateTime instance from the computed creation time
    • asDate

      default Date asDate()
      Get the creation date/time as regular Java Date instance
      Returns:
      A Date instance from the computed creation time
    • asDuration

      default Duration asDuration()
      Get the elapsed duration for this clock in the standard Java Duration
      Returns:
      A new Duration instance representing the elapsed duration for this clock