boost之progress_timer计时器
来源:互联网 发布:青少年法治网络大赛 编辑:程序博客网 时间:2024/05/21 22:25
progress_timer计时器继承自timer,具有timer的全部能力。除此之外,它会在析构时自动输出时间,省去了timer调用elapsed()的工作。
#include "stdafx.h"#include <boost/progress.hpp>int main(){boost::progress_timer t; //声明对象开始计时int i = 10000000000; //操作while (i--); return 0;} //退出作用域,调用析构函数,输出流逝的时间输出结果是:
把progress_timer的输出转移到了stringstream中,它可以被转换为字符串供其他应用使用
#include <boost/progress.hpp>#include <sstream>int main(){std::stringstream str;{boost::progress_timer t; //声明对象开始计时int i = 10000000000; //操作while (i--);return 0;}//退出作用域,调用析构函数,输出流逝的时间std::string temp = str.str();std::cout << temp << std::endl;}输出结果是:
0 0
- boost之progress_timer计时器
- boost计时器 timer progress_timer progress_display
- BOOST 计时器类 timer 、progress_timer
- boost 计时器精度扩展 progress_timer 计时器扩展 类模版
- boost ---- boost::progress_timer
- Boost库学习------progress_timer
- boost库之时间处理(timer,progress_timer, progress_display)
- 【Boost】timer、progress_timer和progress_display
- c++ boost--------------boost::progress_timer小试。
- progress_timer
- Boost库的progress_timer和progress_display讲解
- Boost 计时器 定时器 速记
- Boost Timer 计时器
- 计时器 boost asio
- Boost程序库完全开发指南阅读笔记(一) -- timer , progress_timer , progress_display
- Boost学习1--计时器的实现
- BOOST-计时器-同步、异步(boost::asio::deadline_timer)
- Javascript技巧之计时器和倒计时器
- UGUI实现UI精灵由小到大渐变效果——配合unity动画曲线
- Android虚拟导航栏遮挡底部的输入框
- D
- java位运算符的使用场景
- 图—搜索——BFS
- boost之progress_timer计时器
- docker的数据管理
- -----树状数组模板
- Mysql Select 语句中实现的判断
- java.util.concurrent.TimeoutException at java.util.concurrent.FutureTask$Sync.innerGet
- Files 的值“ < < < < < < < .mine”无效。路径中具有非法字符。
- template函数
- 初学Servlet的注意事项
- NYOJ 79 拦截导弹 (动态规划)