Use Qt::TimerType on UNIX when scheduling timers
authorBradley T. Hughes <bradley.hughes@nokia.com>
Wed, 21 Dec 2011 10:34:07 +0000 (11:34 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 5 Jan 2012 21:15:25 +0000 (22:15 +0100)
commitc46654b3a5deb92f5ac2ce41be9d7a302dd04db5
tree8d3ae1a1f1a70bddb54ffe7be934e386bb5def9e
parentc355c300d92666c82c2f66c493329c783b8b9811
Use Qt::TimerType on UNIX when scheduling timers

As stated in the documentation for Qt::TimerType, we allow for up to
5% error for CoarseTimers (the default timer type). PreciseTimers are
not adjusted at all, and VeryCoarseTimers fire with one-second accuracy.
The objective is to make most timers wake up at the same time, thereby
reducing CPU wakeups.

Note that this changes makes it possible for timers to fire early, which
may be unexpected for some applications. Such applications should use
PreciseTimers explicitly.

Author: Thiago Macieira <thiago.macieira@nokia.com>
Change-Id: Iaa70314c39a446adbc6dbb6fdfa7bafcd98a7283
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/kernel/qtimerinfo_unix.cpp
src/corelib/kernel/qtimerinfo_unix_p.h