//取64位时间戳
#include <iostream>
#include<windows.h>
#include<thread>
#include<chrono>
using namespace std;
int64_t get_time_us()
{
std::chrono::system_clock clock;
return std::chrono::duration_cast<std::chrono::microseconds>(
clock.now().time_since_epoch()).count();
}
int _tmain(int argc, _TCHAR* argv[])
{
int i=0;
int64_t t1=0;
int64_t t2=0;
int64_t t3=0;
int64_t t4=0;
t1=get_time_us();
this_thread::sleep_for(chrono::milliseconds(10));//c++11 休眠函数
t2=get_time_us();
cout<<t2-t1 <<endl;
t3=get_time_us();
Sleep(10);
t4=get_time_us();
cout<<t4-t3 <<endl;
system("pause");
return 0;
}