#include <boost/chrono.hpp>
#include <boost/timer/timer.hpp>
void main()
{
//计算函数调用占用的时间
boost::timer::cpu_timer timer;
//...
boost::timer::cpu_times time = timer.elapsed();
int wall_time_ = time.wall / 1000000; //纳秒转毫秒
system("pause");
}
#include <boost/timer/timer.hpp>
void main()
{
//计算函数调用占用的时间
boost::timer::cpu_timer timer;
//...
boost::timer::cpu_times time = timer.elapsed();
int wall_time_ = time.wall / 1000000; //纳秒转毫秒
system("pause");
}