17 #ifndef CYBER_TIME_CLOCK_H_ 18 #define CYBER_TIME_CLOCK_H_ 22 #include "cyber/proto/run_mode_conf.pb.h" 31 using ::apollo::cyber::proto::ClockMode;
42 std::chrono::system_clock::duration::period::den /
43 std::chrono::system_clock::duration::period::num;
46 static_assert(PRECISION >= 1000000,
47 "The precision of the system clock should be at least 1 " 78 static ClockMode
mode();
99 #endif // CYBER_TIME_CLOCK_H_ ::apollo::cyber::Time Time
Definition: racobit_radar_message_manager.h:41
static void SetNowInSeconds(const double seconds)
This is for mock clock mode only. It will set the timestamp for the mock clock with UNIX timestamp in...
Definition: clock.h:84
static constexpr int64_t PRECISION
Definition: clock.h:41
static void SetNow(const Time &now)
This is for mock clock mode only. It will set the timestamp for the mock clock.
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: atomic_rw_lock.h:36
#define DECLARE_SINGLETON(classname)
Definition: macros.h:52
a singleton clock that can be used to get the current timestamp. The source can be either system(cybe...
Definition: clock.h:39
static void SetMode(ClockMode mode)
static ClockMode mode()
Gets the current clock mode.
static Time Now()
PRECISION >= 1000000 means the precision is at least 1us.
Cyber has builtin time type Time.
Definition: time.h:31
static double NowInSeconds()
gets the current time in second.