代码拉取完成,页面将自动刷新
/*
* time_utility.h
*
* Created on: 2016年4月22日
* Author: guyadong
*/
#ifndef COMMON_SOURCE_CPP_TIME_UTILITS_H_
#define COMMON_SOURCE_CPP_TIME_UTILITS_H_
#include <ctime>
namespace gdface{
/*
* 用于运行时间计算的类
*/
struct time_probe_type{
clock_t _start;
/* 开始计时 */
void start(){
_start=clock();
}
/* 计时结束返回时间(秒) */
float end(){
return float(clock()-_start)/CLOCKS_PER_SEC;
}
};
/* TLS变量用于同一线程内的程序执行时间统计 */
thread_local static time_probe_type tls_clock_probe;
} /* namespace gdface */
#endif /* COMMON_SOURCE_CPP_TIME_UTILITS_H_ */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。