I've got a small problem caused by insufficient documentation of C++11.
I'd like to obtain a time since epoch in milliseconds, or nanoseconds or seconds and then I will have to "cast" this value to another resolution.
I can do it using gettimeofday() but it will be to easy, so I tried to achieve it using std::chrono.
std::chrono::time_point<std::chrono::system_clock> now =
You can do
now.time_since_epoch() to get a duration representing the time since the epoch, with the clock's resolution. To convert to milliseconds use
auto duration = now.time_since_epoch(); auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count();