Simplify randomSleep() for old Qt version

This commit is contained in:
Shatur95 2021-04-10 14:37:33 +03:00 committed by Hennadii Chernyshchyk
parent 9f65e9c7fe
commit c2fd401540

View File

@ -471,7 +471,7 @@ void SingleApplicationPrivate::randomSleep()
QThread::msleep( QRandomGenerator::global()->bounded( 8u, 18u ));
#else
qsrand( QDateTime::currentMSecsSinceEpoch() % std::numeric_limits<uint>::max() );
QThread::msleep( 8 + static_cast <unsigned long>( static_cast <float>( qrand() ) / RAND_MAX * 10 ));
QThread::msleep( qrand() % 11 + 8);
#endif
}