标签:ble get 了解 tick das count() cout 运行时 dash
首先,我们需要需要了解两个函数——getTickCount()和getTickFrequency()
getTickCount()函数返回CPU自某个事件以来走过的时钟周期数,getTickFrequency()函数返回CPU一秒钟包含的时钟周期数。
以秒为单位为某操作计时的方法如下:
double time0 = static_cast<double>(getTickCount());//记录起始时间
//进行某项操作
.........
time0 = ((static_cast<double>(getTickCount()))-time0)/getTickFrequency() ;
cout<<"运行时间:"<<time0<<"秒"<<endl ;//输出运行时间
标签:ble get 了解 tick das count() cout 运行时 dash
原文地址:https://www.cnblogs.com/lurx/p/12336098.html