#include "MicroTimer.h" using namespace std; using namespace std::chrono; static_assert(ratio_less_equal::value, "MicroTimer: steady_clock doesn't support microsecond resolution"); MicroTimer::MicroTimer() { reset(); } MicroTimer::~MicroTimer() { } void MicroTimer::reset() { begin = steady_clock::now(); } int MicroTimer::elapsed() const { auto now = steady_clock::now(); return std::chrono::duration_cast>(now - begin).count(); }