c++里怎么用time函数计时

[复制链接]
查看11 | 回复0 | 2010-4-19 18:52:11 | 显示全部楼层 |阅读模式
#include /*秒表*/#include #include #include using namespace std;int main(void){SYSTEMTIME now;time_t s1,s2;BYTE bKeys[256]; GetLocalTime(&now);s1=time(NULL);s2=time(NULL);start:cout #include using namespace std;int main(void) {
time_t first, second;
cout<<"Please press Enter to start!"<<endl; getchar(); first = time( NULL );
cout<<"Please press Enter again to stop!"<<endl; getchar(); second = time( NULL );
cout<<"The during time is:"<<difftime(second,first)<<" seconds\n"<<endl;
return 0; }
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行