QTimer timeout delay debug mode in MSVC2010
-
Hello,
I'm trying an implementation that uses a timer having a 20ms timeout. The SLOT called by the timeout SIGNAL does a considerable amount of work and relies on the accumulated time from the timeouts to return the desirable output in a QGraphicsScene/View.
When executing the app in release mode everything runs fine and smooth.
In debug mode, using Visual Studio 2010 Ultimate, I found the timer to have slight delays that blow the usability of the application. The delay increases with the amount of work done by the GUI thread.Is this a MSVC2010 issue or do you recommend another type of implementation? Maybe relying on the system time instead of the 20ms value?
Thanks in advance...
-
[quote author="tcampos" date="1340035695"]
Is this a MSVC2010 issue or do you recommend another type of implementation? Maybe relying on the system time instead of the 20ms value?
[/quote]
This might depend on your implementation. I guess you simply define a QTimer with a 20 ms interval. It should be fired more or less every 20 ms. There are other thread concentrating on the variations caused by the scheduling of the OS. This should be system time. What should it be?The debug mode compilations are typically requiring more time for processing. If you run your application compiled in debug in the debugger it even more time. If the CPU consumption for slot routine is already close to 20 ms, it is very likely that it take more than 20 ms in the debugger.