The main problem with QTimer is that it uses the Qt event loop for synchronization. Unfortunately, it may not be sufficiently accurate, in fact. The delay for notifications and everything in the event loop interferes.
You will need to consider a timer, which is actually not very dependent on the Qt event loop, for example QueryPerformanceCounter()on Windows. This is how we get to the kingdom of QElapsedTimer.
Thus, I would use QElapsedTimer for this purpose.
The following post has a custom class implemented for this purpose, as it seems. You can take it as it is, and then customize it to your needs even better if necessary.
High resolution timer
lpapp source
share