计时器 boost.Timer
接口
elapsed()
报告当前跑了多久了。 结果包括:
struct cpu_times
{
nanosecond_type wall;
nanosecond_type user;
nanosecond_type system;
void clear() { wall = user = system = 0LL; }
};
start()
开始计时stop()
结束计时resume()
重新开始计时
例子
#include <boost/timer/timer.hpp>
#include <chrono>
#include <thread>
int main() {