timeBeginPeriod(1);
char string[10];
int timestart;
timestart=timeGetTime();
for (long int z=0;z<50000;z++);
timestart=timeGetTime()-timestart;
itoa(timestart,string,10);
AfxMessageBox(string);
timeEndPeriod(1);
int start = time(NULL);
for (long int z=0;z<50000;z++);
printf("\nThe elapsed time was %d seconds for %d times NULL iterations",
time(NULL) - start, z);
就行了!