The std::chrono library added in C++11 enables simple time measurement.
The library provides two types for storing time information: time points and durations.
std::chrono supports the expected time manipulation operations, time literals (C++14), iostream and std::format formatting (C++20).
Compiler Explorer link: https://compiler-explorer.com/z/zvG5d4aMz
@simontoth nit: you don't need \n with println
@vitaut That was for a neater output in the compiler explorer example. Didn't think about cleaning it up.
@simontoth Makes sense.