How to get a std::chrono::time_point representing [now]?
In order to get a std::chrono::time_point<std::chrono::system_clock>
representing the current point in time, use std::chrono::system_clock::now()
std::chrono::time_point<std::chrono::system_clock> now = std::chrono::system_clock::now();
Typically, you would use auto
to avoid having to type out (or read) the long typename of std::chrono::time_point<std::chrono::system_clock>
:
auto now = std::chrono::system_clock::now();