# **[](https://en.cppreference.com/w/cpp/header/chrono)** provides time utilities: `std::chrono::system_clock` (wall time), `std::chrono::steady_clock` (monotonic, never goes backwards), and `std::chrono::high_resolution_clock` (highest precision available). You work with `duration` (a time interval) and `time_point` (a specific moment). For benchmarking or measuring elapsed time, always use `steady_clock`. For absolute dates, use `system_clock`. ## Example This example measures the elapsed time of a sleep operation using `steady_clock` and converts the duration to milliseconds. ```cpp // compile: g++ -std=c++11 -o chronoexample chronoexample.cpp // run: ./chronoexample // description: measure elapsed time #include #include #include int main() { auto start = std::chrono::steady_clock::now(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); auto end = std::chrono::steady_clock::now(); auto elapsed_ms = std::chrono::duration_cast(end - start); std::cout << "elapsed: " << elapsed_ms.count() << " ms\n"; return 0; } ```