diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2016-04-26 23:01:43 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-08-15 03:07:16 +0000 |
| commit | 12eacc3bab00f23d187a295b35e4a0d283ba85f4 (patch) | |
| tree | 93a4e36fac6474921d45ce4a9383d5b49e6f5ee7 /src/corelib/kernel/qelapsedtimer.cpp | |
| parent | 906fc0f5e394d4d765cb714a52ea46643abcec1e (diff) | |
Long live QDeadlineTimer
It's like QElapsedTimer, but marks a time in the future instead.
[ChangeLog][QtCore] Added QDeadlineTimer, a counterpart to
QElapsedTimer, used to mark a time point in the future (a deadline) and
determine whether such a deadline has passed.
Change-Id: Ifea6e497f11a461db432ffff144921f7fbc1d1d3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/kernel/qelapsedtimer.cpp')
| -rw-r--r-- | src/corelib/kernel/qelapsedtimer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/kernel/qelapsedtimer.cpp b/src/corelib/kernel/qelapsedtimer.cpp index 2eabb4c3a35..4aa9f9bffa3 100644 --- a/src/corelib/kernel/qelapsedtimer.cpp +++ b/src/corelib/kernel/qelapsedtimer.cpp @@ -83,6 +83,9 @@ QT_BEGIN_NAMESPACE \snippet qelapsedtimer/main.cpp 2 + It is often more convenient to use \ref{QDeadlineTimer} in this case, which + counts towards a timeout in the future instead of tracking elapsed time. + \section1 Reference Clocks QElapsedTimer will use the platform's monotonic reference clock in all @@ -120,7 +123,7 @@ QT_BEGIN_NAMESPACE The information on which clocks types may overflow and how to remedy that issue is documented along with the clock types. - \sa QTime, QTimer + \sa QTime, QTimer, QDeadlineTimer */ /*! @@ -255,7 +258,7 @@ bool QElapsedTimer::isValid() const Q_DECL_NOTHROW The value of \a timeout can be -1 to indicate that this timer does not expire, in which case this function will always return false. - \sa elapsed() + \sa elapsed(), QDeadlineTimer */ bool QElapsedTimer::hasExpired(qint64 timeout) const Q_DECL_NOTHROW { |
