51 #if defined(QT_NO_CLOCK_MONOTONIC) || defined(QT_BOOTSTRAPPED) 53 # ifdef _POSIX_MONOTONIC_CLOCK 54 # undef _POSIX_MONOTONIC_CLOCK 56 # define _POSIX_MONOTONIC_CLOCK -1 61 #if (_POSIX_MONOTONIC_CLOCK-0 != 0) 70 # define is_likely(x) __builtin_expect((x), 1) 72 # define is_likely(x) (x) 74 #define load_acquire(x) ((volatile const int&)(x)) 75 #define store_release(x,v) ((volatile int&)(x) = (v)) 79 #if (_POSIX_MONOTONIC_CLOCK-0 == 0) 83 # if defined(_SC_MONOTONIC_CLOCK) 85 long x = sysconf(_SC_MONOTONIC_CLOCK);
123 #if (_POSIX_MONOTONIC_CLOCK-0 >= 0) 127 clock_gettime(CLOCK_MONOTONIC, &ts);
135 ::gettimeofday(&tv, 0);
160 frac = *nowfrac - frac;
182 return sec *
Q_INT64_C(1000000000) + frac;
205 return other.
t1 -
t1;
210 return v1.
t1 < v2.
t1 || (v1.
t1 == v2.
t1 && v1.
t2 < v2.
t2);
#define store_release(x, v)
ClockType
This enum contains the different clock types that QElapsedTimer may use.
#define QT_END_NAMESPACE
This macro expands to.
qint64 msecsTo(const QElapsedTimer &other) const
Returns the number of milliseconds between this QElapsedTimer and other.
friend bool Q_CORE_EXPORT operator<(const QElapsedTimer &v1, const QElapsedTimer &v2)
Returns true if v1 was started before v2, false otherwise.
The QElapsedTimer class provides a fast way to calculate elapsed times.
static bool isMonotonic()
Returns true if this is a monotonic clock, false otherwise.
qint64 elapsed() const
Returns the number of milliseconds since this QElapsedTimer was last started.
#define QT_BEGIN_NAMESPACE
This macro expands to.
qint64 restart()
Restarts the timer and returns the time elapsed since the previous start.
static int monotonicClockAvailable
static int monotonicClockChecked
qint64 nsecsElapsed() const
Returns the number of nanoseconds since this QElapsedTimer was last started.
static qint64 fractionAdjustment()
static ClockType clockType()
Returns the clock type that this QElapsedTimer implementation uses.
#define _POSIX_MONOTONIC_CLOCK
static qint64 elapsedAndRestart(qint64 sec, qint64 frac, qint64 *nowsec, qint64 *nowfrac)
static void unixCheckClockType()
qint64 msecsSinceReference() const
Returns the number of milliseconds between last time this QElapsedTimer object was started and its re...
static void do_gettime(qint64 *sec, qint64 *frac)
void start()
Starts this timer.
qint64 secsTo(const QElapsedTimer &other) const
Returns the number of seconds between this QElapsedTimer and other.