C/C++程序计时函数gettimeofday的使用
2024-09-07 12:20:49
linux 环境下
用 clock_t发现不准。
换用
//头文件
#include <sys/time.h>
//使用
timeval start, end;
gettimeofday(&start, NULL);
sleep();
gettimeofday(&end, NULL);
cout << *(end.tv_sec - start.tv_sec) + (end.tv_usec - start.tv_usec)/ << endl;
//输出ms
最新文章
- tachyon of zybo cluster
- cocos2dx 3.0 之 lua 创建类 (二)
- nginx是一个反向代理的软件
- TCPIP三次握手详情
- 安卓之cannot convert from Fragment1 to Fragment
- Gradient Descent 和 Stochastic Gradient Descent(随机梯度下降法)
- android - 自定义(组合)控件 + 自定义控件外观
- Python tkinter调整元件在窗口中的位置与几何布局管理
- dubbo服务治理中间件,zookeeper注册中心
- How to set spring boot active profiles with maven profiles
- 关于 gitignore
- string 转 int
- 支付宝 ILLEGAL_SIGN
- 升级node后还是原来版本问题
- vc6.0问题
- 搭建 RabbitMQ Server 高可用集群【转】
- 自动化测试-12.selenium的弹出框处理
- 自学Linux Shell3.1-帮助命令man
- Codeforces Round #256 (Div. 2) B (448B) Suffix Structures
- Jquery中的height(),innerHeight(),outerHeight()的区别
热门文章
- 设计模式学习笔记——State状态模式
- MYSQL初级学习笔记五:连接查询!(视频序号:初级_37-41)
- 修改fuse库成功
- 在Service里调用AlertDialog
- DP专辑之最长公共子序列及其变形
- AutoIt:获取计算机已安装程序列表
- 微信小程序开发之https从无到有
- Asp.net MVC 中使用 Ninject 实现依赖注入
- ios::sync_with_stdio(false);
- Spring boot 启动报错:com.mongodb.MongoSocketOpenException: Exception opening socket