Clocks
The fact that there are three different types of clocks begs the question: What are the differences?
-
std::chrono::sytem_clock: is the system-wide real-time clock (wall-clock). The clock has the auxiliary functions
to_time_t
andfrom_time_t
to convert time points into calendar time. -
std::chrono::steady_clock: is the only clock to provide the guarantee that you can not adjust it. Therefore,
std::chrono::steady_clock
is the preferred clock to measure time intervals. -
std::chrono::high_resolution_clock: is the clock with the highest accuracy but it can be simply an alias for the clocks
std::chrono::system_clock
orstd::chrono::steady_clock
.