I\'ve created a time point, but I have been struggling to print it to the terminal.
#include
#include
int main(){
//set
The nanoseconds seems to be part of the problem, looking at the documentation a bit I was able to get this to work:
#include
#include
#include
int main(){
//set time_point to current time
std::chrono::time_point time_point;
time_point = std::chrono::system_clock::now();
std::time_t ttp = std::chrono::system_clock::to_time_t(time_point);
std::cout << "time: " << std::ctime(&ttp);
return 0;
}
Although it looks like std::chrono::microseconds works ok:
std::chrono::time_point time_point;