Time Duration
Explore how C++17's chrono library manages time durations, from measuring differences between time points to using predefined and custom ratios. Learn to work with floating-point durations, understand conversion rules, and apply built-in literals to handle various time units efficiently.
We'll cover the following...
We'll cover the following...
Time duration
Time duration is the difference between the two time-points. Time duration is measured in the number of ticks.
If Rep is a floating-point number, the time duration supports fractions of ticks. The most important time durations are predefined in the chrono library:
How long can a time duration be? The C++ standard guarantees that the predefined time durations can store +/- 292 years. ...