C++|计算时间差

#include 
auto start = std::chrono::system_clock::now();
// do something
auto here = std::chrono::system_clock::now();
unsigned int timeUsed = std::chrono::duration_cast<std::chrono::milliseconds>(here - start).count();			
#include 
DWORD start_time = 0;
DWORD end_time ;
end_time = GetTickCount(); //从操作系统启动经过的毫秒数
if (end_time - start_time > 1500)
{
	double time_ = end_time - start_time;
	double time_s = time_ /1000;
	start_time = end_time;
}

你可能感兴趣的:(C/C++/qt,c++,开发语言)