// // Created by Eddy Ekofo on 09/05/2020. // #pragma once #include #include class Benchmark { public: Benchmark() : start_point_(std::chrono::high_resolution_clock::now()){}; ~Benchmark() { Stop(); } void Stop() { auto end_time = std::chrono::steady_clock::now(); auto start = std::chrono::time_point_cast( start_point_) .time_since_epoch() .count(); auto end = std::chrono::time_point_cast(end_time) .time_since_epoch() .count(); auto duration = end - start; double ms = duration * 0.001; std::cout << "Time: " << ms << " ms" << "\n"; } private: std::chrono::time_point start_point_; };