• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
一蓑烟雨
C/C++,Linux,语音技术
博客园    首页    新随笔    联系   管理    订阅  订阅
时间与日期
 1 // timer.cpp : 定义控制台应用程序的入口点。
 2 //
 3 
 4 #include "stdafx.h"
 5 #include <iostream>
 6 #include <boost/timer.hpp>
 7 #include <boost/progress.hpp>
 8 #include <boost/date_time.hpp>
 9 
10 using namespace std;
11 /*记时器*/
12 void timer()
13 {
14     boost::timer t;
15     cout << t.elapsed_max() << endl;
16     cout << t.elapsed_min() << endl;
17     cout << t.elapsed() << endl;
18     t.restart();
19     cout << t.elapsed() << endl;
20 }
21 /*记时器*/
22 void progress_timer()
23 {
24     boost::progress_timer t;
25     cout << t.elapsed_max() << endl;
26     cout << t.elapsed_min() << endl;
27     cout << t.elapsed() << endl;
28     t.restart();
29     cout << t.elapsed() << endl;
30 }
31 /*输出当前时间*/
32 void current_time()
33 {
34     boost::posix_time::ptime t=boost::posix_time::second_clock::local_time();
35     cout<< t <<endl;
36 }
37 int _tmain(int argc, _TCHAR* argv[])
38 {
39 //    timer();
40 //    progress_timer();
41     current_time();
42     return 0;
43 }

 

posted on 2013-01-29 17:16  lovemu  阅读(398)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3