<time.h>
LARGE_INTEGER frequency,start,stop;
QueryPerformanceFrequency(&frequency);
srand(time(NULL));
QueryPerformanceCounter(&start);
QueryPerformanceCounter(&stop);
double time;
time = (stop.QuadPart-start.QuadPart)*1000/frequency.QuadPart;
printf("Time:%fms\n",time);
另一个方式:
timeGetTime