1// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QT3DCORE_QTICKCLOCK_P_H
4#define QT3DCORE_QTICKCLOCK_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists for the convenience
11// of other Qt classes. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <Qt3DCore/qt3dcore_global.h>
18#include <QtCore/QElapsedTimer>
19#include <private/qglobal_p.h>
20
21QT_BEGIN_NAMESPACE
22
23namespace Qt3DCore {
24
25class QTickClock
26{
27public:
28 QTickClock();
29
30 void setTickFrequency(float frequency);
31
32 void start();
33 void reset();
34
35 qint64 waitForNextTick();
36
37private:
38 QElapsedTimer m_timer;
39 qint64 m_tickInterval;
40 qint64 m_time;
41};
42
43} // namespace Qt3DCore
44
45QT_END_NAMESPACE
46
47#endif // QT3DCORE_QTICKCLOCK_P_H
48

source code of qt3d/src/core/qtickclock_p.h