From 7332e42363eb93f1de032319439a7250e16b3b12 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 17 Aug 2009 20:15:26 +0200 Subject: Doc: Clarified the difference between timer resolution and accuracy. Task-number: 222555 Reviewed-by: Trust Me --- src/corelib/kernel/qtimer.cpp | 20 ++++++++++++++++---- 1 file 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 -- cgit v0.12