Documentation Home >> Headers >> <chrono> Header >> std::chrono::high_resolution_clock typedef

The std::chrono::high_resolution_clock class provides access to the system-wide clock with the highest resolution. As for all clocks, the current time can be obtained by calling std::chrono::high_resolution_clock::now(). std::chrono::high_resolution_clock may be a typedef for the std::chrono::system_clock class, std::chrono::monotonic_clock class or std::chrono::steady_clock class, or may be a separate type.

Though std::chrono::high_resolution_clock has the highest resolution of all the library-supplied clocks, std::chrono::high_resolution_clock::now() still takes a finite amount of time. Care must be taken to account for the overhead of calling std::chrono::high_resolution_clock::now() when timing short operations.

class high_resolution_clock
    typedef unspecified-integral-type rep;
    typedef std::ratio<
        unspecified,unspecified> period;
    typedef std::chrono::duration<rep,period> duration;
    typedef std::chrono::time_point<
        unspecified> time_point;
    static const bool is_steady=unspecified;

    static time_point now() noexcept;

    // for backwards compatibility only
    static const bool is_monotonic=unspecified;

#include <chrono>

See Also