How to stop recursive single shot timer after 240 second ?
Solved
Mobile and Embedded
-
Below you can see that my startcalibration function is call MagnetometerCalibration function
how to stop this recursive call after 240 second ?
void startcalibration()
{
QTimer::singleShot(1,this, SLOT(MagnetometerCalibration()));
}bool MagnetometerCalibration()
{
QTimer::singleShot(1,this, SLOT(MagnetometerCalibration()));
} -
@Qt-embedded-developer
use a QElapsedTimer as member variable,in startCalibration, start it,
in MagnetometerCalibration check if the elapsed time is below 250 ms