A the moment, it seemed like a good solution to use what C++ lib provides.
I strongly disagree.
Yet you are proposing using C++ lib as well
Quote:
My proposition is to use steady_clock for msecs instead:
int msecs(int prev)
{
auto p2 = std::chrono::steady_clock::now();
return (int)std::chrono::duration_cast<std::chrono::milliseconds>(p2.time_since_epoch()).count() - prev;
}
Accepted. I think this is a good idea, we just need to remember that msecs is steady and usecs is not. I guess there is little harm that way - we can anticipate the use of msecs to synchronize things like sockets and usecs to benchmark things (and that is notoriously unstable for other reasons too).