[Development] Nanosecond accuracy timer

Thiago Macieira thiago.macieira at intel.com
Mon Nov 2 17:04:42 CET 2020


On Monday, 2 November 2020 06:15:57 PST David Jackson wrote:
> The Qt API needs a QTimer with nanosecond accuracy. I know what is actually
> provided by underlying platforms varies greatly. But instead of Qt
> introducing its own limitation, Qt needs to provide a way for what the
> underlying platform can support to be accessed. If a platform does not
> support nanosecond accuracy, it can simply be rounded to the accuracy that
> the platform supports. select() on Linux and other OSs supports nanosecond
> interval, so a nanosecond interval can simply be passed straight through to
> select on those platforms. I know it is no guarantee that it is actually
> nanosecond accuracy, and probably not, but just expose the nanosecond
> interface that the OS supports and let the developer determine their own
> strategy and needs.

This is unfortunately a Qt 7 task. Changing QAbstractEventDispatcher right now 
and updating all the platform dispatchers this late in the 6.0 cycle is too 
dangerous.

Also note that, by default, Qt introduces up to 5% error (on Unix; my change 
for Windows has never been merged).

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering





More information about the Development mailing list