If You really need this method do it like this :
void myProg:tDelay(int milliSecs)
{
QElapsedTimer timer;
timer.restart();
qint64 nanoSec;
timer.start();
QTimer::singleShot( milliSecs,
&loop,
SLOT(quit
()) );
loop.exec();
nanoSec = timer.nsecsElapsed();
qDebug() << nanoSec;
}
void myProg:tDelay(int milliSecs)
{
QElapsedTimer timer;
timer.restart();
qint64 nanoSec;
timer.start();
QEventLoop loop;
QTimer::singleShot( milliSecs,&loop,SLOT(quit()) );
loop.exec();
nanoSec = timer.nsecsElapsed();
qDebug() << nanoSec;
}
To copy to clipboard, switch view to plain text mode
Bookmarks