17#ifndef CYBER_TIME_CLOCK_H_
18#define CYBER_TIME_CLOCK_H_
22#include "cyber/proto/run_mode_conf.pb.h"
31using ::apollo::cyber::proto::ClockMode;
42 std::chrono::system_clock::duration::period::den /
43 std::chrono::system_clock::duration::period::num;
47 "The precision of the system clock should be at least 1 "
78 static ClockMode
mode();
a singleton clock that can be used to get the current timestamp.
static ClockMode mode()
Gets the current clock mode.
static constexpr int64_t PRECISION
static void SetNowInSeconds(const double seconds)
This is for mock clock mode only.
static void SetMode(ClockMode mode)
static double NowInSeconds()
gets the current time in second.
static void SetNow(const Time &now)
This is for mock clock mode only.
static Time Now()
PRECISION >= 1000000 means the precision is at least 1us.
Cyber has builtin time type Time.
#define DECLARE_SINGLETON(classname)