// SPDX-FileCopyrightText: 2020 Icinga GmbH // SPDX-License-Identifier: GPL-3.0-or-later #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 */