summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-08-17 18:15:26 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-08-17 18:15:26 (GMT)
commit7332e42363eb93f1de032319439a7250e16b3b12 (patch)
tree84d767be10c2876d2c07890617dbcd84fac360e1
parent285d4b12cb937a5672d6eb15781f03d249f8cfc1 (diff)
downloadQt-7332e42363eb93f1de032319439a7250e16b3b12.zip
Qt-7332e42363eb93f1de032319439a7250e16b3b12.tar.gz
Qt-7332e42363eb93f1de032319439a7250e16b3b12.tar.bz2
Doc: Clarified the difference between timer resolution and accuracy.
Task-number: 222555 Reviewed-by: Trust Me
-rw-r--r--src/corelib/kernel/qtimer.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index f40f491..2e34592 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -101,10 +101,22 @@ QT_BEGIN_NAMESPACE
more and more platforms, and we expect that zero-millisecond
QTimers will gradually be replaced by \l{QThread}s.
- Note that QTimer's accuracy depends on the underlying operating
- system and hardware. Most platforms support an accuracy of
- 1 millisecond. If Qt is unable to deliver the requested number of
- timer clicks, it will silently discard some.
+ \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.
+
+ \section1 Alternatives to QTimer
An alternative to using QTimer is to call QObject::startTimer()
for your object and reimplement the QObject::timerEvent() event