/* Icinga 2 | (c) 2020 Icinga GmbH | GPLv2+ */ #ifndef BENCHMARK_H #define BENCHMARK_H #include namespace icinga { /** * A stopwatch. * * @ingroup base */ template class Benchmark final { public: inline void Start() { m_Start = Clock::now(); } inline double Stop() { return std::chrono::duration((Clock::now() - m_Start)).count(); } private: typename Clock::time_point m_Start; }; } #endif /* BENCHMARK_H */