#pragma once #include #include struct auto_cpu_timer { std::chrono::time_point start; auto_cpu_timer() : start(std::chrono::high_resolution_clock::now()) { } ~auto_cpu_timer() { auto end = std::chrono::high_resolution_clock::now(); std::chrono::microseconds elapsed = std::chrono::duration_cast(end - start); std::cerr << elapsed.count() << "us" << std::endl; } };