Wire Sysio
Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_benchmark.cpp
Go to the documentation of this file.
1
/*
2
* Created by Phil on 04/07/2017.
3
* Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
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
#include "
catch_benchmark.h
"
10
#include "
catch_capture.hpp
"
11
#include "
catch_interfaces_reporter.h
"
12
#include "
catch_context.h
"
13
14
namespace
Catch
{
15
16
auto
BenchmarkLooper::getResolution() ->
uint64_t
{
17
return
getEstimatedClockResolution
() *
getCurrentContext
().
getConfig
()->benchmarkResolutionMultiple();
18
}
19
20
void
BenchmarkLooper::reportStart
() {
21
getResultCapture
().
benchmarkStarting
( { m_name } );
22
}
23
auto
BenchmarkLooper::needsMoreIterations
() ->
bool
{
24
auto
elapsed = m_timer.getElapsedNanoseconds();
25
26
// Exponentially increasing iterations until we're confident in our timer resolution
27
if
( elapsed < m_resolution ) {
28
m_iterationsToRun *= 10;
29
return
true
;
30
}
31
32
getResultCapture
().
benchmarkEnded
( { { m_name }, m_count, elapsed } );
33
return
false
;
34
}
35
36
}
// end namespace Catch
catch_benchmark.h
catch_capture.hpp
catch_context.h
catch_interfaces_reporter.h
Catch::BenchmarkLooper::reportStart
void reportStart()
Definition
catch_benchmark.cpp:20
Catch::BenchmarkLooper::needsMoreIterations
auto needsMoreIterations() -> bool
Definition
catch_benchmark.cpp:23
Catch
Definition
231-Cfg-OutputStreams.cpp:32
Catch::getCurrentContext
IContext & getCurrentContext()
Definition
catch_context.h:52
Catch::getEstimatedClockResolution
auto getEstimatedClockResolution() -> uint64_t
Definition
catch_timer.cpp:52
Catch::getResultCapture
IResultCapture & getResultCapture()
Definition
catch_run_context.cpp:494
uint64_t
unsigned __int64 uint64_t
Definition
stdint.h:136
Catch::IContext::getConfig
virtual IConfigPtr const & getConfig() const =0
Catch::IResultCapture::benchmarkStarting
virtual void benchmarkStarting(BenchmarkInfo const &info)=0
Catch::IResultCapture::benchmarkEnded
virtual void benchmarkEnded(BenchmarkStats const &stats)=0
libraries
sys-vm
external
Catch2
include
internal
catch_benchmark.cpp
Generated by
1.12.0