[Development] Nanosecond accuracy timer

Mårten Nordheim marten.nordheim at qt.io
Mon Nov 2 15:22:17 CET 2020


Maybe QDeadlineTimer and QElapsedTimer covers your needs?



From: Development <development-bounces at qt-project.org> on behalf of David Jackson <djackson452 at gmail.com>
Sent: Monday, November 2, 2020 15:15
To: development at qt-project.org
Subject: [Development] Nanosecond accuracy timer

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.

More information about the Development mailing list