Documentation Home >> Headers >> <chrono> Header >> std::chrono::time_point class template

The std::chrono::time_point class template represents a point in time, as measured by a particular clock. It is specified as a duration since the epoch of that particular clock. The template parameter Clock identifies the clock (each distinct clock must have a unique type), whilst the Duration template parameter is the type to use for measuring the duration since the epoch, and must be an instantiation of the std::chrono::duration class template. The Duration defaults to the default duration type of the Clock.

template <
    class Clock,
    class Duration = typename Clock::duration>
class time_point
{
public:
    typedef Clock clock;
    typedef Duration duration;
    typedef typename duration::rep rep;
    typedef typename duration::period period;

    time_point();
    explicit time_point(const duration& d);

    template <class Duration2>
    time_point(const time_point<clock, Duration2>& t);

    duration time_since_epoch() const;

    time_point& operator+=(const duration& d);
    time_point& operator-=(const duration& d);

    static constexpr time_point min();
    static constexpr time_point max();
};
Header

#include <chrono>

See Also