Class SystemClock

java.lang.Object
com.loomcache.server.consensus.SystemClock
All Implemented Interfaces:
Clock

public class SystemClock extends Object implements Clock
System clock implementation using System.nanoTime().

This is the production clock for all Raft timing operations. For testing, use TestClock instead.

  • Field Details

  • Method Details

    • nanoTime

      public long nanoTime()
      Description copied from interface: Clock
      Returns the current time in nanoseconds.

      The absolute value is meaningless; only differences matter. This is analogous to System.nanoTime().

      Specified by:
      nanoTime in interface Clock
      Returns:
      nanoseconds since an arbitrary reference point