-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
should use system_clock instead of high_resolution_clock for timestamp_now #11
Comments
Hi, Can you give me a reference where it mentions steady_clock epoch is not Jan 1, 1970. Thanks. |
Search steady_clock from google could result lots of discussions about system_clock, steady_clock, etc. Below are 2 of those references: cppreference,stackoverflow |
With libc++, high_resolution_clock epoch is the last boot time. |
Also affected on windows VS2015, I get time stamps as [1970-01-02 06:01:03.451556]. system_clock works as expected [2017-02-02 12:22:14.434341]. If high_resolution_clock is important for time stamps, may be offset can be used?
|
[2018-05-01 21:17:45.272498][INFO][20072][c:\work\nanolog\main.cpp:main:20] Sample NanoLog: 0 |
Only system_clock's epoch is guaranteed to be January 1, 1970, while steady_clock's epoch maybe not. high_resolution_clock maybe a synonym for system_clock or steady_clock. So system_clock should be used to get time_since_epoch if the desired epoch is January 1, 1970.
The text was updated successfully, but these errors were encountered: