File indexing completed on 2025-01-30 10:02:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef CATCH_MEASURE_HPP_INCLUDED
0011 #define CATCH_MEASURE_HPP_INCLUDED
0012
0013 #include <catch2/benchmark/detail/catch_complete_invoke.hpp>
0014 #include <catch2/benchmark/detail/catch_timing.hpp>
0015 #include <catch2/internal/catch_move_and_forward.hpp>
0016
0017 namespace Catch {
0018 namespace Benchmark {
0019 namespace Detail {
0020 template <typename Clock, typename Fun, typename... Args>
0021 TimingOf<Clock, Fun, Args...> measure(Fun&& fun, Args&&... args) {
0022 auto start = Clock::now();
0023 auto&& r = Detail::complete_invoke(fun, CATCH_FORWARD(args)...);
0024 auto end = Clock::now();
0025 auto delta = end - start;
0026 return { delta, CATCH_FORWARD(r), 1 };
0027 }
0028 }
0029 }
0030 }
0031
0032 #endif