How to get the difference between two points in time in milliseconds
std::chrono::duration has two template parameters, the second being exactly the unit of measure. You can invoke std::chrono::duration_cast to cast from one duration type to another. Also, there is a predefined duration type for milliseconds: std::chrono::milliseconds. Composing this together: auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(foo – now); To get the actual number of milliseconds, use duration::count: auto ms … Read more