diff --git a/include/exectime.h b/include/exectime.h new file mode 100644 index 00000000..3e269eee --- /dev/null +++ b/include/exectime.h @@ -0,0 +1,17 @@ +#pragma once +#include +#include + +class ExecTime { + static auto begin = std::chrono::high_resolution_clock::now(); + + static void start() { + begin = std::chrono::high_resolution_clock::now(); + } + + static void log(std::string operation) { + long long int timeMicros = std::chrono::duration_cast( + std::chrono::high_resolution_clock::now() - begin).count(); + std::cout << "Time taken for " << operation << ": " << timeMicros << "us" << std::endl; + } +}; \ No newline at end of file