Time in C++: Inter-Clock Conversions, Epochs, and Durations
sandordargo.com·3d·
Discuss: Hacker News
Abseil Time
Preview
Report Post

By now in this series, we’ve spent time looking at the major standard clocks and their behavior. We’ve talked about wall-clock time, monotonic clocks, and the myths around “high resolution”. Today, we are going to talk about a subtle area: how clocks relate to each other, how epochs differ, and what happens when you - need to - convert durations.

It sounds simple, right? A timestamp is a timestamp, and a duration is just a number of seconds - or other time units. But <chrono> is designed to be type-safe, and it enforces some rules that prevent accidental misuse. Once…

Similar Posts

Loading similar posts...