Using boost::chrono::steady_clock
or std::chrono::steady_clock
is suppose to guarantee that physical time is always monotonic and is not affected by date time changes in the system. Here is my question, if I have two processes that need to be immune to system date time changes, is it enough to exchange just the time_since_epoch
? In other words, the time interpretation of the two processes to the same time since epoch will be the same? Specifically I need to answer this question for Windows and QNX.
EDIT: Both processes are running in the same computer, same operating system and communicate via IPC calls.
No the times are not interchangeable between systems, because C++ doesn't specify the epoch. The epoch is depending on the operating system, different systems can have different epochs.
If, on the other hand, you share the times only locally, within the same system, then it's okay.