Class Timestamp
java.lang.Object
com.ctre.phoenix6.Timestamp
Information about the timestamp of a signal.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new invalid Timestamp.Timestamp(double time, Timestamp.TimestampSource source) Constructs a new Timestamp for the given source.Timestamp(double time, Timestamp.TimestampSource source, boolean valid) Constructs a new Timestamp for the given source. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the latency of this timestamp compared to now in seconds.Gets the latency of this timestamp compared to now.Gets the source of this timestamp.doublegetTime()Gets the time of this timestamp in seconds.Gets the time of this timestamp.booleanisValid()Gets whether this Timestamp is valid.
-
Constructor Details
-
Timestamp
public Timestamp()Constructs a new invalid Timestamp. -
Timestamp
Constructs a new Timestamp for the given source.- Parameters:
time- The time in secondssource- The timestamp source
-
Timestamp
Constructs a new Timestamp for the given source.- Parameters:
time- The time in secondssource- The timestamp sourcevalid- 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
-
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
Gets the latency of this timestamp compared to now.- Returns:
- Difference between now and this timestamp
-