CTRE Phoenix 6 C++ 25.0.0-beta-4
Loading...
Searching...
No Matches
ctre::phoenix6::utils Namespace Reference

Functions

CTREXPORT double GetCurrentTimeSeconds ()
 Get the current timestamp in seconds.
 
CTREXPORT double GetSystemTimeSeconds ()
 Get the system timestamp in seconds.
 
CTREXPORT bool IsSimulation ()
 Get whether the program is running in simulation.
 
CTREXPORT bool IsReplay ()
 Get whether the program is running in replay mode.
 
units::second_t GetCurrentTime ()
 Get the current timestamp.
 
units::second_t GetSystemTime ()
 Get the system timestamp.
 
units::second_t FPGAToCurrentTime (units::second_t fpgaTime)
 Converts an FPGA timestamp to the timebase reported by GetCurrentTime().
 

Function Documentation

◆ FPGAToCurrentTime()

units::second_t ctre::phoenix6::utils::FPGAToCurrentTime ( units::second_t fpgaTime)
inline

Converts an FPGA timestamp to the timebase reported by GetCurrentTime().

Parameters
fpgaTimeThe FPGA timestamp
Returns
The equivalent GetCurrentTime() timestamp

◆ GetCurrentTime()

units::second_t ctre::phoenix6::utils::GetCurrentTime ( )
inline

Get the current timestamp.

This is the time source used for status signals.

This time source is typically continuous and monotonic. However, it may be overridden in simulation to use a non-monotonic, non-continuous source.

Returns
Current time

◆ GetCurrentTimeSeconds()

CTREXPORT double ctre::phoenix6::utils::GetCurrentTimeSeconds ( )

Get the current timestamp in seconds.

This is the time source used for status signals.

This time source is typically continuous and monotonic. However, it may be overridden in simulation to use a non-monotonic, non-continuous source.

Returns
Current time in seconds.

◆ GetSystemTime()

units::second_t ctre::phoenix6::utils::GetSystemTime ( )
inline

Get the system timestamp.

This is NOT the time source used for status signals. Use GetCurrentTime instead when working with status signal timing.

This time source is guaranteed to be continuous and monotonic, making it useful for measuring time deltas in a robot program.

Returns
System time

◆ GetSystemTimeSeconds()

CTREXPORT double ctre::phoenix6::utils::GetSystemTimeSeconds ( )

Get the system timestamp in seconds.

This is NOT the time source used for status signals. Use GetCurrentTimeSeconds instead when working with status signal timing.

This time source is guaranteed to be continuous and monotonic, making it useful for measuring time deltas in a robot program.

Returns
System time in seconds.

◆ IsReplay()

CTREXPORT bool ctre::phoenix6::utils::IsReplay ( )

Get whether the program is running in replay mode.

Returns
true if in replay mode

◆ IsSimulation()

CTREXPORT bool ctre::phoenix6::utils::IsSimulation ( )

Get whether the program is running in simulation.

Returns
true if in simulation