I need to get milliseconds from the timer
// get timer part
time_t timer = time(NULL);
struct tm now = *localtime( &timer );
char timesta
#include
typedef std::chrono::system_clock Clock;
auto now = Clock::now();
auto seconds = std::chrono::time_point_cast(now);
auto fraction = now - seconds;
time_t cnow = Clock::to_time_t(now);
Then you can print out the time_t with seconds precision and then print whatever the fraction represents. Could be milliseconds, microseconds, or something else. To specifically get milliseconds:
auto milliseconds = std::chrono::duration_cast(fraction);
std::cout << milliseconds.count() << '\n';