| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
// Copyright Catch2 Authors |
|
3
|
|
|
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. |
|
4
|
|
|
|
|
|
|
// (See accompanying file LICENSE_1_0.txt or copy at |
|
5
|
|
|
|
|
|
|
// https://www.boost.org/LICENSE_1_0.txt) |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
// SPDX-License-Identifier: BSL-1.0 |
|
8
|
|
|
|
|
|
|
// Adapted from donated nonius code. |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#ifndef CATCH_MEASURE_HPP_INCLUDED |
|
11
|
|
|
|
|
|
|
#define CATCH_MEASURE_HPP_INCLUDED |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#include |
|
14
|
|
|
|
|
|
|
#include |
|
15
|
|
|
|
|
|
|
#include |
|
16
|
|
|
|
|
|
|
#include |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
namespace Catch { |
|
19
|
|
|
|
|
|
|
namespace Benchmark { |
|
20
|
|
|
|
|
|
|
namespace Detail { |
|
21
|
|
|
|
|
|
|
template |
|
22
|
0
|
|
|
|
|
|
TimingOf measure(Fun&& fun, Args&&... args) { |
|
23
|
0
|
|
|
|
|
|
auto start = Clock::now(); |
|
24
|
0
|
0
|
|
|
|
|
auto&& r = Detail::complete_invoke(fun, CATCH_FORWARD(args)...); |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
auto end = Clock::now(); |
|
26
|
0
|
|
|
|
|
|
auto delta = end - start; |
|
27
|
0
|
|
|
|
|
|
return { delta, CATCH_FORWARD(r), 1 }; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
} // namespace Detail |
|
30
|
|
|
|
|
|
|
} // namespace Benchmark |
|
31
|
|
|
|
|
|
|
} // namespace Catch |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#endif // CATCH_MEASURE_HPP_INCLUDED |