C++ timer计时设计
#include <ctime>
namespace my_timer
{
class timer
{
public:
timer(){ _start_time = std::clock();};
void restrart(){_start_time = std::clock();};
double elapsed() const{return double(std::clock() - _start_time) / CLOCKS_PER_SEC; }
double elapsed_max() const {}
double elapsed_min() const{return double(1)/double(CLOCKS_PER_SEC);}
private:
clock_t _start_time;
};
}