Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qbenchmarkmeasurement_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QBENCHMARKMEASUREMENT_P_H
5#define QBENCHMARKMEASUREMENT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtTest/qbenchmark.h>
19#include <QtCore/qlist.h>
20#include <QtCore/private/qglobal_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QBenchmarkMeasurerBase
25{
26public:
27 struct Measurement
28 {
29 qreal value;
30 QTest::QBenchmarkMetric metric;
31 };
32 virtual ~QBenchmarkMeasurerBase() = default;
33 virtual void start() = 0;
34 virtual QList<Measurement> stop() = 0;
35 virtual bool isMeasurementAccepted(Measurement m) = 0;
36 virtual int adjustIterationCount(int suggestion) = 0;
37 virtual int adjustMedianCount(int suggestion) = 0;
38 virtual bool needsWarmupIteration() { return false; }
39};
40
41QT_END_NAMESPACE
42
43#endif // QBENCHMARKMEASUREMENT_P_H