#include<iostream>
#include<stdio.h>
#include<time.h>
#include<windows.h>
using namespace std;
int main(void){
clock_t start,end;
start=clock();
Sleep(1000);
end=clock();
cout<<"The time was:"<<(end - start) /CLK_TCK<<endl;
return 0;
}
在vc6.0下运行该程序,sleep()括号内为1000~1999的返回值都为1秒,不是说clock()的精度为1毫秒吗?请问肿么回事?
慕田峪9158850
肥皂起泡泡
蛊毒传说
相关分类