QT 5.6.0

Hello,

I'm using a time delay in my program, and noticed a drastic difference
in execution time between Windows 10 and Windows 7 (Dual boot system).
The time delay does not have to accurate (Animation).

Typical output:-
15156535 Windows 10
1379155 Windows 7

Its probably the processEvents, I would like the system to be responsive.
Is there a better way to achive similar results between the two systems?

Regards

Qt Code:
  1. void myProg:tDelay(int milliSecs)
  2. {
  3. QElapsedTimer timer;
  4. timer.restart();
  5. qint64 nanoSec;
  6. timer.start();
  7.  
  8. QTime dieTime = QTime::currentTime().addMSecs(milliSecs);
  9. while (QTime::currentTime() < dieTime)
  10. QCoreApplication::processEvents(QEventLoop::AllEvents, 1);
  11.  
  12. nanoSec = timer.nsecsElapsed();
  13. qDebug() << nanoSec;
  14. }
To copy to clipboard, switch view to plain text mode