I would like to call the doStuff() function at 50Hz. This is what I am doing now:
mTimer = new QTimer(this););
connect(mTimer, SIGNAL(timeout()), SLOT(doStuff()));
mTimer->start(20);
But the result is that doStuff() is only called around 30Hz. The doStuff() call itself might take some time (several ms, but always less than 20ms). What might be the problem here?