mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2024-11-15 12:15:43 +08:00
Simplify randomSleep() for old Qt version
This commit is contained in:
parent
9f65e9c7fe
commit
c2fd401540
@ -471,7 +471,7 @@ void SingleApplicationPrivate::randomSleep()
|
|||||||
QThread::msleep( QRandomGenerator::global()->bounded( 8u, 18u ));
|
QThread::msleep( QRandomGenerator::global()->bounded( 8u, 18u ));
|
||||||
#else
|
#else
|
||||||
qsrand( QDateTime::currentMSecsSinceEpoch() % std::numeric_limits<uint>::max() );
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user