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
qbenchmark.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QBENCHMARK_H
5#define QBENCHMARK_H
6
7#include <QtTest/qttestglobal.h>
8#include <QtTest/qbenchmarkmetric.h>
9
10QT_BEGIN_NAMESPACE
11
12
13namespace QTest
14{
15
16//
17// W A R N I N G
18// -------------
19//
20// The QBenchmarkIterationController class is not a part of the
21// Qt Test API. It exists purely as an implementation detail.
22//
23//
24class Q_TESTLIB_EXPORT QBenchmarkIterationController
25{
26public:
31 bool isDone() const noexcept;
32 void next() noexcept;
33 int i;
34};
35
36}
37
38// --- BEGIN public API ---
39
40#define QBENCHMARK
41 for (QTest::QBenchmarkIterationController _q_iteration_controller;
42 _q_iteration_controller.isDone() == false; _q_iteration_controller.next())
43
44#define QBENCHMARK_ONCE
45 for (QTest::QBenchmarkIterationController _q_iteration_controller(QTest::QBenchmarkIterationController::RunOnce);
46 _q_iteration_controller.isDone() == false; _q_iteration_controller.next())
47
48namespace QTest
49{
51}
52
53// --- END public API ---
54
55QT_END_NAMESPACE
56
57#endif // QBENCHMARK_H