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