boost::timer库使用

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; } };
原文地址:https://www.cnblogs.com/dj0325/p/9151907.html