boost::timer boost库定时器使用,需要在编译时加相关链接库 -lboost_timer -lboost_system

 

boost::timer::cpu_timer 和boost::timer::auto_cpu_timer用于精确定时,有start(),elapsed(),is_stopped()等方法,elapsed()方法返回的时结构体boost::timer::cpu_times

struct cpu_times
{
//时间单位都为ns nanosecond_type wall;   //程序运行实际时间 nanosecond_type user;  //用户层cpu时间 nanosecond_type system;  //内核系统cpu时间
void clear() {wall = user = system = 0LL; } };

 

相关文章:

  • 2021-12-26
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2021-06-11
  • 2021-06-29
  • 2022-12-23
猜你喜欢
  • 2021-12-16
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2021-10-04
相关资源
相似解决方案