Conversion between google.protobuf.Timestamp and std::chrono::time_point<std::chrono::steady_clock>

Viewed 477

I'm trying to properly convert a std::chrono::time_point<std::chrono::steady_clock> (C++) to a google.protobuf.Timestamp (protocol buffers) and back again to a steady_clock.

I would prefer it to be represented in nanosecond resolution as the data I plan to serialize / deserialize are timestamped measurements which will be evaluated in a different context.

As I fail to find a definitive standard of the epoch time for std::chrono::time_point<std::chrono::steady_clock> I wonder if anyone else have tried it out?

Thanks for any answer :)

0 Answers
Related