Tag: chrono
5 posts
-
C++20 Calendar and Time Zones: year_month_day, zoned_time and DST Pitfalls
C++20 chrono dates and time zones: calendar vs day arithmetic, the Jan 31 + 1 month problem, weekdays, zoned_time conversion, DST gaps and overlaps.
-
C++ chrono::time_point: Clocks, Epochs, Timeouts, and Elapsed Time
How std::chrono::time_point ties a duration to a clock, steady_clock vs system_clock, time_point_cast, and timeouts, timestamps and elapsed-time measurement.
-
C++ sleep_for vs sleep_until: Drift, Clock Choice and Cancellable Waits
How std::this_thread::sleep_for and sleep_until really behave: oversleeping, fixed-rate loops without drift, steady vs system clock, and waits you can cancel.
-
steady_clock vs system_clock vs high_resolution_clock: Measuring Elapsed Time and Timeouts
When to use steady_clock vs system_clock in C++, why high_resolution_clock is system_clock on GCC, and how to time code and timeouts correctly.
-
C++ std::chrono::duration: Units, Literals, and Safe Conversions
Working with std::chrono::duration in C++ - representing time intervals, chrono literals like 500ms and 2h, converting between units safely, C++20 calendar literals, and avoiding truncation bugs.