当前位置:网站首页>Timer usage notes
Timer usage notes
2022-06-24 07:48:00 【Fog dispels eyesight】
timer Use notes
windows platform :
CreateWaitableTimer
SetWaitableTimer
boost library :
timer
progress_timer
progress_display
timer Equivalent to a timer ( millisecond ), At the same time, relevant operation functions are provided for programmers to use .
// Import header file ,.hpp by .h+cpp, Such files do not need to be precompiled
#include<boost/timer.hpp>
#include<iostream>
using namespace std;
// Use boost Namespace
using namespace boost;
int main()
{
timer t;// Define a timer , Start timing from definition
// The maximum time of the timer
cout << "max timespan:" << t.elapsed_max() / 3600 << "h" << endl;
// Minimum timer time
cout << "min timespan:" << t.elapsed_min() << "s" << endl;
// Output the current timing time of the timer
cout << "now time elapsed" << t.elapsed() << "s" << endl;
}
timer Another common method is as follows :
// Retime
void restart(){_start_time = std::clock();}
progress_timer At the time of deconstruction Automatically call elspsed()
meanwhile progress_timer It can also cooperate with stringstream To use , Information can be output in stringstream in
stringstream s;
{
progress_timer t(s);// After the scope is out, the information will be entered in s in , Instead of printing it out
}
cout << s.str()<< endl;// Can pass s take t To print the timing information
progress_display It has a display function
May refer to :https://blog.csdn.net/qq_42214953/article/details/105841155
边栏推荐
- Cloud development who is the source code of undercover applet
- UTC、GMT、CST
- Lend you a pair of insight, Frida native trace
- New features of PHP: bytecode cache and built-in server
- Global and Chinese market of Earl Grey tea 2022-2028: Research Report on technology, participants, trends, market size and share
- 简单的折射效果
- 科一易错点
- BOM notes
- Global and Chinese markets for maritime transport of perishable goods 2022-2028: Research Report on technology, participants, trends, market size and share
- any类备注
猜你喜欢

爬虫基础B1——Scrapy(B站学习笔记)

What kind of experience is it when the Institute earns 20000 yuan a month!

First acquaintance with JUC - day01

开放合作,共赢未来 | 福昕鲲鹏加入金兰组织

慕思股份在深交所上市:毛利率持续下滑,2022年一季度营销失利

ImportError: cannot import name ‘process_pdf‘ from ‘pdfminer.pdfinterp‘错误完全解决

【Django中运行scrapy框架,并将数据存入数据库】

Free ICP domain name filing interface

光照使用的简单总结

云开发谁是卧底小程序源码
随机推荐
Blue Bridge Cup seven segment code (dfs/ shape pressing + parallel search)
Detailed explanation of PHP data serialization test example
鸿蒙开发四
BOM notes
本地备份和还原 SQL Server 数据库
面试中的最常被问到的两种锁
The startup mode of cloudbase init is \Cloudbase init has hidden dangers
Global and Chinese market of basketball uniforms 2022-2028: Research Report on technology, participants, trends, market size and share
阿里云全链路数据治理
行内元素、块元素、行内块元素
UE常用控制臺命令
Anaconda 中使用 You Get
爬虫基础B1——Scrapy(B站学习笔记)
Terminal network in VPN client connection settings of router
Deploy L2TP in VPN (medium)
Global and Chinese market of bed former 2022-2028: Research Report on technology, participants, trends, market size and share
《canvas》之第2章 直线图形
语料库数据处理个案实例(句子检索相关个案)
Unity Culling 相关技术
后疫情时代下,家庭服务机器人行业才刚启航