#pragma once #include #include #include #define time_now() std::chrono::high_resolution_clock::now() using ns = std::chrono::nanoseconds; using ms = std::chrono::milliseconds; template auto to_duration(const std::chrono::duration &delta) { return std::chrono::duration_cast(delta).count(); } template auto timer(F func, Args &&... args) { auto start_time = time_now(); func(std::forward(args)...); return to_duration(time_now() - start_time); }