summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-10-01 11:25:48 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-02 03:15:09 +0200
commitc74f60b09dc031b19ebfa11718d44fb06a5569b2 (patch)
treefc93ba0e8c1f3b78d6207096161d1fe3995801b3 /src/corelib
parent649e0b6002490decfff6477d15229786e9db8f9c (diff)
Doc: correct QTimer accuracy information - it depends on the timer type
This doc was probably older than the feature of timer types. Task-number: QTBUG-33760 Change-Id: Iff4c9f9bb7287498f1ee80578b500bbde777bc78 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qtimer.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 667c490d31..71d8d99a91 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -103,18 +103,23 @@ QT_BEGIN_NAMESPACE
\section1 Accuracy and Timer Resolution
- Timers will never time out earlier than the specified timeout value
- and they are not guaranteed to time out at the exact value specified.
- In many situations, they may time out late by a period of time that
- depends on the accuracy of the system timers.
-
The accuracy of timers depends on the underlying operating system
and hardware. Most platforms support a resolution of 1 millisecond,
though the accuracy of the timer will not equal this resolution
in many real-world situations.
- If Qt is unable to deliver the requested number of timer clicks,
- it will silently discard some.
+ The accuracy also depends on the \l{Qt::TimerType}{timer type}. For
+ Qt::PreciseTimer, QTimer will try to keep the accurance at 1 millisecond.
+ Precise timers will also never time out earlier than expected.
+
+ For Qt::CoarseTimer and Qt::VeryCoarseTimer types, QTimer may wake up
+ earlier than expected, within the margins for those types: 5% of the
+ interval for Qt::CoarseTimer and 500 ms for Qt::VeryCoarseTimer.
+
+ All timer types may time out later than expected if the system is busy or
+ unable to provide the requested accuracy. In such a case of timeout
+ overrun, Qt will emit activated() only once, even if multiple timeouts have
+ expired, and then will resume the original interval.
\section1 Alternatives to QTimer