46 #include <mach/mach_time.h> 60 static mach_timebase_info_data_t
info = {0,0};
64 mach_timebase_info(&
info);
78 uint64_t cpu_time = mach_absolute_time();
80 tv.tv_sec = nsecs / 1000000000ull;
81 tv.tv_usec = (nsecs / 1000) - (tv.tv_sec * 1000000);
87 t1 = mach_absolute_time();
94 t1 = mach_absolute_time();
102 uint64_t cpu_time = mach_absolute_time();
108 uint64_t cpu_time = mach_absolute_time();
129 return v1.
t1 < v2.
t1;
static mach_timebase_info_data_t info
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.
qint64 nsecsElapsed() const
Returns the number of nanoseconds since this QElapsedTimer was last started.
static ClockType clockType()
Returns the clock type that this QElapsedTimer implementation uses.
qint64 msecsSinceReference() const
Returns the number of milliseconds between last time this QElapsedTimer object was started and its re...
static qint64 absoluteToMSecs(qint64 cpuTime)
static qint64 absoluteToNSecs(qint64 cpuTime)
void start()
Starts this timer.
qint64 secsTo(const QElapsedTimer &other) const
Returns the number of seconds between this QElapsedTimer and other.