Documentation Home >> Headers >> <chrono> Header

The <chrono> header provides classes for representing points in time and durations, and clock classes which act as a source of time_points. Each clock has an is_steady static data member which indicates whether or not it is a steady clock that advances at a uniform rate (and cannot be adjusted). The std::chrono::steady_clock class and std::chrono::monotonic_clock class are the only clocks guaranteed to be steady.

namespace std
{
    namespace chrono
    {
        template<
            typename Rep,typename Period = ratio<1>>
        class duration;

        template<
            typename Clock,
            typename Duration =
                typename Clock::duration>
        class time_point;

        class system_clock;
        class steady_clock;
        typedef unspecified-clock-type
            high_resolution_clock;

        // for backwards compatibility only
        class monotonic_clock;
    }

    namespace literals
    {
        namespace chrono_literals
        {
            constexpr chrono::hours operator"" h(unsigned long long);
            constexpr chrono::duration<unspecified , ratio<3600,1>> operator"" h(long double);
            constexpr chrono::minutes operator"" min(unsigned long long);
            constexpr chrono::duration<unspecified , ratio<60,1>>  operator"" min(long double);
            constexpr chrono::seconds operator"" s(unsigned long long);
            constexpr chrono::duration<unspecified >  operator"" h(long double);
            constexpr chrono::milliseconds operator"" ms(unsigned long long);
            constexpr chrono::duration<unspecified , milli> operator"" ms(long double);
            constexpr chrono::microseconds operator"" us(unsigned long long);
            constexpr chrono::duration<unspecified , micro> operator"" us(long double);
            constexpr chrono::nanoseconds operator"" ns(unsigned long long);
            constexpr chrono::duration<unspecified , nano> operator"" ns(long double);
        }
    }
}
See Also