会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
献给俺地朋友们
包子环游世界
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
::
公告
c++ timer
//
this code is writen by c++
#include
<
iostream
>
#include
<
ctime
>
using
namespace
std;
class
timer
{
clock_t start;
public
:
timer();
//
set new time
~
timer();
//
distory time() and get new time
}
;
timer::timer()
{
start
=
clock;
}
timer::
~
timer()
{
clock_t end;
end
=
clock();
cout
<<
"
Elapsed time:
"
<<
(end
-
start)
/
CLOCKS_PER_SEC
<<
endl;
}
int
main()
{
timer ob;
char
c;
ob.timer();
//
for()
//
cin >> c;
return
0
;
}
the code above teaches me how to measure time in c++;and also there is another way in c,gettimeofday function.
posted on
2004-11-18 15:14
半吊子程序员
阅读(
1674
) 评论(
0
)
收藏
举报
刷新页面
返回顶部