Class Timestamp

java.lang.Object
com.ctre.phoenix6.Timestamp

public final class Timestamp extends Object
Information about the timestamp of a signal.
  • Constructor Details

    • Timestamp

      public Timestamp()
      Constructs a new invalid Timestamp.
    • Timestamp

      public Timestamp(double time, Timestamp.TimestampSource source)
      Constructs a new Timestamp for the given source.
      Parameters:
      time - The time in seconds
      source - The timestamp source
    • Timestamp

      public Timestamp(double time, Timestamp.TimestampSource source, boolean valid)
      Constructs a new Timestamp for the given source.
      Parameters:
      time - The time in seconds
      source - The timestamp source
      valid - Whether the timestamp is valid (true by default)
  • Method Details

    • getTime

      public double getTime()
      Gets the time of this timestamp in seconds.
      Returns:
      Time of this timestamp in seconds
    • getTimeMeasure

      public Time getTimeMeasure()
      Gets the time of this timestamp.
      Returns:
      Time of this timestamp
    • getSource

      public Timestamp.TimestampSource getSource()
      Gets the source of this timestamp.
      Returns:
      Source of this timestamp
    • isValid

      public boolean isValid()
      Gets whether this Timestamp is valid.
      Returns:
      true if this timestamp is valid
    • getLatency

      public double getLatency()
      Gets the latency of this timestamp compared to now in seconds.
      Returns:
      Difference between now and this timestamp in seconds
    • getLatencyMeasure

      public Time getLatencyMeasure()
      Gets the latency of this timestamp compared to now.
      Returns:
      Difference between now and this timestamp