1. 

#include <time.h>

time_t begin_t  = clock();
// to do 
time_t finish_t = clock();

cout<<"it cost " << (double )(finish_t - begin_t )/CLOCKS_PER_SEC <<" s"<<endl;

2.

#include <boost/timer.hpp>

boost::timer timer; /
/ to do cout<<" cost time: "<<timer.elapsed() <<endl;

 

相关文章:

  • 2021-12-15
  • 2021-12-07
  • 2022-12-23
  • 2021-09-05
  • 2021-10-19
猜你喜欢
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2021-12-27
  • 2021-06-29
相关资源
相似解决方案