catch_timing.hpp 977 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Created by Joachim on 16/04/2019.
  3. * Adapted from donated nonius code.
  4. *
  5. * Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. */
  8. // Timing
  9. #ifndef TWOBLUECUBES_CATCH_DETAIL_TIMING_HPP_INCLUDED
  10. #define TWOBLUECUBES_CATCH_DETAIL_TIMING_HPP_INCLUDED
  11. #include "../catch_clock.hpp"
  12. #include "catch_complete_invoke.hpp"
  13. #include <tuple>
  14. #include <type_traits>
  15. namespace Catch {
  16. namespace Benchmark {
  17. template <typename Duration, typename Result>
  18. struct Timing {
  19. Duration elapsed;
  20. Result result;
  21. int iterations;
  22. };
  23. template <typename Clock, typename Func, typename... Args>
  24. using TimingOf = Timing<ClockDuration<Clock>, Detail::CompleteType_t<FunctionReturnType<Func, Args...>>>;
  25. } // namespace Benchmark
  26. } // namespace Catch
  27. #endif // TWOBLUECUBES_CATCH_DETAIL_TIMING_HPP_INCLUDED