1 /*
2  * DQt - D bindings for the Qt Toolkit
3  *
4  * GNU Lesser General Public License Usage
5  * This file may be used under the terms of the GNU Lesser
6  * General Public License version 3 as published by the Free Software
7  * Foundation and appearing in the file LICENSE.LGPL3 included in the
8  * packaging of this file. Please review the following information to
9  * ensure the GNU Lesser General Public License version 3 requirements
10  * will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
11  */
12 module qt.core.elapsedtimer;
13 extern(C++):
14 
15 import qt.config;
16 import qt.core.global;
17 import qt.helpers;
18 
19 /// Binding for C++ class [QElapsedTimer](https://doc.qt.io/qt-6/qelapsedtimer.html).
20 extern(C++, class) struct /+ Q_CORE_EXPORT +/ QElapsedTimer
21 {
22 public:
23     enum ClockType {
24         SystemTime,
25         MonotonicClock,
26         TickCounter,
27         MachAbsoluteTime,
28         PerformanceCounter
29     }
30 
31     @disable this();
32     /+this()
33     {
34         this.t1 = 0x8000000000000000L;
35         this.t2 = 0x8000000000000000L;
36     }+/
37 
38     static ClockType clockType()/+ noexcept+/;
39     static bool isMonotonic()/+ noexcept+/;
40 
41     void start()/+ noexcept+/;
42     qint64 restart()/+ noexcept+/;
43     void invalidate()/+ noexcept+/;
44     bool isValid() const/+ noexcept+/;
45 
46     qint64 nsecsElapsed() const/+ noexcept+/;
47     qint64 elapsed() const/+ noexcept+/;
48     bool hasExpired(qint64 timeout) const/+ noexcept+/;
49 
50     qint64 msecsSinceReference() const/+ noexcept+/;
51     qint64 msecsTo(ref const(QElapsedTimer) other) const/+ noexcept+/;
52     qint64 secsTo(ref const(QElapsedTimer) other) const/+ noexcept+/;
53 
54     /+ friend bool operator==(const QElapsedTimer &lhs, const QElapsedTimer &rhs) noexcept
55     { return lhs.t1 == rhs.t1 && lhs.t2 == rhs.t2; } +/
56     /+ friend bool operator!=(const QElapsedTimer &lhs, const QElapsedTimer &rhs) noexcept
57     { return !(lhs == rhs); } +/
58 
59     /+ friend bool Q_CORE_EXPORT operator<(const QElapsedTimer &lhs, const QElapsedTimer &rhs) noexcept; +/
60 
61 private:
62     qint64 t1 = 0x8000000000000000L;
63     qint64 t2 = 0x8000000000000000L;
64     mixin(CREATE_CONVENIENCE_WRAPPERS);
65 }
66