当前位置: 首页 > news >正文

珠宝 东莞网站建设房子设计图平面图

珠宝 东莞网站建设,房子设计图平面图,网站建设是前端后端吗,海口紧急通告1. 关键词2. 问题3. 解决思路4. 代码实现 4.1. timecount.h4.2. timecount.cpp 5. 测试代码6. 运行结果7. 源码地址 1. 关键词 C 时间处理 统计函数运行时间 跨平台 2. 问题 C如何简单便捷地实现“函数运行时间的统计”功能#xff1f; 3. 解决思路 类的构造函数#x…1. 关键词2. 问题3. 解决思路4. 代码实现 4.1. timecount.h4.2. timecount.cpp 5. 测试代码6. 运行结果7. 源码地址 1. 关键词 C 时间处理 统计函数运行时间 跨平台 2. 问题 C如何简单便捷地实现“函数运行时间的统计”功能 3. 解决思路 类的构造函数会在对象初始化的时候被调用。类的析构函数会在对象销毁的时候被调用。局部对象的生命周期对象实例化也就是初始化时开始退出作用域时结束。 4. 代码实现 4.1. timecount.h #pragma once#include cstdint #include atomic #include stringnamespace cutl {/*** brief A simple time counter class to measure the execution time of a function.**/class timecount{public:/*** brief Construct a new timecount object* The constructor will record the begin time of the function calling.* param func_name*/timecount(const std::string func_name);/*** brief Destroy the timecount object* The desctructor will record the end time of the function calling and calculate the execution time.*/~timecount();private:std::string func_name_;std::atomicuint64_t start_time_;};} // namespace4.2. timecount.cpp #include timecount.h #include timeutil.h #include strfmt.h #include inner/logger.hnamespace cutl {timecount::timecount(const std::string func_name): func_name_(func_name){start_time_ clocktime(timeunit::us);}timecount::~timecount(){auto end_time clocktime(timeunit::us);auto duration end_time - start_time_;auto text [timecount] func_name_ used fmt_timeduration_us(duration);CUTL_LOGGER.info(, text);} } // namespace5. 测试代码 #pragma once#include iostream #include timecount.h #include common.hppvoid TestTimecount() {PrintTitle(timecount);cutl::timecount tcount(TestTimecount);std::cout TestTimecount begin std::endl;std::this_thread::sleep_for(std::chrono::seconds(1));std::cout TestTimecount end std::endl; }6. 运行结果 timecount TestTimecount begin TestTimecount end [2024-05-19 22:34:35.853][I]]0x7ff844a9b100](cutl) [timecount] TestTimecount used 01s.004955us7. 源码地址 更多详细代码请查看本人写的C 通用工具库: common_util, 本项目已开源代码简洁且有详细的文档和Demo。
http://www.w-s-a.com/news/521718/

相关文章:

  • 商务网站的特点ui软件界面设计
  • 广州个性化网站开发网站索引量是什么意思
  • 公司网站制作专业公司python做后台网站的多吗
  • 桂林建站平台哪家好给别人做网站怎么收取费用
  • python做网站显示表格用visual做的网站
  • 彩票网站建设需要什么聊城网站建设首选天成网络
  • 安徽建设工程网站wordpress标签云代码
  • 推荐佛山顺德网站建设手机网站建设域名空间
  • 电子商务网站建设策划书例子企业官网用什么cms系统
  • 网站栏目设计怎么写平面设计接单报价表
  • 做网站美工要学什么网站推广的方法包括
  • 哪个网站可以做笔译兼职wordpress加表单
  • 百度站内搜索 wordpress微餐饮建站费用
  • 用什么做网站的访问量统计制作手工作品
  • 微信公众号搭建网站河南卫生基层系统网站建设
  • steam账号注册网站重庆手机版建站系统哪家好
  • 中新生态城建设局门户网站wordpress云盘视频播放
  • 大型网站开发基本流程wordpress记录用户搜索
  • 云服务器安装win系统做网站wordpress边栏扩大尺寸
  • 网站开发面试自我介绍软件下载网站如何建设
  • 可以做翻译任务的网站陕西省建设厅八大员证
  • 昆明 网站推广重庆网页优化seo公司
  • 网站排名下降怎么上去设计一套app页面多少钱
  • 专门用来查找网址的网站查公司名字是否被注册
  • 自己创建网站教程河南省建设厅官方网站李学军
  • 一个网站需要多少容量怎样免费设计网站建设
  • 建设工程交易中心网站12306的网站是哪个公司做的
  • 建设网站经营范围自己给公司做网站
  • 河北省住房建设厅政务网站网络营销推广的岗位职责有哪些
  • 上海网站建设优化价格孝义做网站的公司