Clocks

This lesson gives a brief introduction to clocks and their usage in C++ with the help of interactive examples.

We'll cover the following...

The fact that there are three different types of clocks begs the question: What are the differences?

  • std::chrono::system_clock: is the system-wide real time clock (wall-clock). The clock has the auxiliary functions to_time_t and from_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 wait for a time duration or until a time point

  • std::chrono::high_resolution_clock: is the ...