C++优化代码ms时间差获取 #include <time.h> clock_t start,ends; start=clock(); Sleep(50); ends=clock(); cout<<ends-start<<endl;