Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:02:48

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 // Adapted from donated nonius code.
0009 
0010 #ifndef CATCH_ENVIRONMENT_HPP_INCLUDED
0011 #define CATCH_ENVIRONMENT_HPP_INCLUDED
0012 
0013 #include <catch2/benchmark/catch_clock.hpp>
0014 #include <catch2/benchmark/catch_outlier_classification.hpp>
0015 
0016 namespace Catch {
0017     namespace Benchmark {
0018         template <typename Duration>
0019         struct EnvironmentEstimate {
0020             Duration mean;
0021             OutlierClassification outliers;
0022 
0023             template <typename Duration2>
0024             operator EnvironmentEstimate<Duration2>() const {
0025                 return { mean, outliers };
0026             }
0027         };
0028         template <typename Clock>
0029         struct Environment {
0030             using clock_type = Clock;
0031             EnvironmentEstimate<FloatDuration<Clock>> clock_resolution;
0032             EnvironmentEstimate<FloatDuration<Clock>> clock_cost;
0033         };
0034     } // namespace Benchmark
0035 } // namespace Catch
0036 
0037 #endif // CATCH_ENVIRONMENT_HPP_INCLUDED