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 9 // Environment information 10 11 #ifndef TWOBLUECUBES_CATCH_ENVIRONMENT_HPP_INCLUDED 12 #define TWOBLUECUBES_CATCH_ENVIRONMENT_HPP_INCLUDED 13 14 #include "catch_clock.hpp" 15 #include "catch_outlier_classification.hpp" 16 17 namespace Catch { 18 namespace Benchmark { 19 template <typename Duration> 20 struct EnvironmentEstimate { 21 Duration mean; 22 OutlierClassification outliers; 23 24 template <typename Duration2> operator EnvironmentEstimate<Duration2>Catch::Benchmark::EnvironmentEstimate25 operator EnvironmentEstimate<Duration2>() const { 26 return { mean, outliers }; 27 } 28 }; 29 template <typename Clock> 30 struct Environment { 31 using clock_type = Clock; 32 EnvironmentEstimate<FloatDuration<Clock>> clock_resolution; 33 EnvironmentEstimate<FloatDuration<Clock>> clock_cost; 34 }; 35 } // namespace Benchmark 36 } // namespace Catch 37 38 #endif // TWOBLUECUBES_CATCH_ENVIRONMENT_HPP_INCLUDED 39