21#include <creos/utils_global.hpp>
23#include <nlohmann/json.hpp>
36 using duration =
typename std::chrono::nanoseconds;
37 using rep =
typename duration::rep;
38 using period =
typename duration::period;
39 using time_point =
typename std::chrono::time_point<RobotClock, duration>;
41 static_assert(duration::min() < duration::zero(),
"a clock's minimum duration cannot be less than its epoch");
43 static constexpr bool is_steady =
false;
48 static time_point from_time_t(std::time_t t)
noexcept;
53 static time_point now()
noexcept;
56inline void to_json(nlohmann::json& j,
const RobotClock::time_point& p) {
57 j = nlohmann::json(p.time_since_epoch().count());
60inline void from_json(
const nlohmann::json& j, RobotClock::time_point& p) {
61 p = RobotClock::time_point(RobotClock::duration(j.get<RobotClock::rep>()));
64static_assert(std::chrono::is_clock_v<RobotClock>);
The clock that represents the robot time.
Definition robot_clock.hpp:34
The main namespace for the CreOS client library.