utils.hpp (463B)
1 #pragma once 2 3 #include <chrono> 4 #include <vector> 5 6 struct Performance { 7 Performance() {} 8 9 ~Performance() { 10 auto end = std::chrono::high_resolution_clock::now(); 11 auto duration = std::chrono::duration<float>(end - start).count(); 12 std::cout << "time: " << std::to_string(duration) << " seconds" << std::endl; 13 } 14 15 std::chrono::time_point<std::chrono::high_resolution_clock> start = std::chrono::high_resolution_clock::now(); 16 };