Class TimeStamp

java.lang.Object
io.ciera.runtime.api.types.TimeStamp
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Date

public class TimeStamp extends Object implements Serializable
The TimeStamp class represents a point in time. It is represented as a quantity of nanoseconds elapsed since an epoch (reference point in time). TimeStamp instances do not inherently define the epoch they are referenced from, but will be interpreted by the runtime based on the current settings of the SystemClock.
See Also:
  • Field Details

    • ZERO

      public static final TimeStamp ZERO
      Default value
  • Constructor Details

    • TimeStamp

      public TimeStamp()
    • TimeStamp

      public TimeStamp(long value)
    • TimeStamp

      public TimeStamp(TimeStamp o)
  • Method Details

    • getValue

      public long getValue()
    • now

      public static TimeStamp now(SystemClock clock)
      Create a new instance of TimeStamp from the current time and epoch set in the system clock.
      Parameters:
      clock - The clock to reference.
      Returns:
      A constructed TimeStamp instance.
    • fromString

      public static TimeStamp fromString(String s)
    • add

      public TimeStamp add(Duration d)
    • subtract

      public TimeStamp subtract(Duration d)
    • subtract

      public Duration subtract(TimeStamp t)
    • toString

      public String toString()
      Overrides:
      toString in class Object