diff options
Diffstat (limited to 'src/copythread.cpp')
-rw-r--r-- | src/copythread.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/copythread.cpp b/src/copythread.cpp index 5b9710b..34d89f4 100644 --- a/src/copythread.cpp +++ b/src/copythread.cpp @@ -3,13 +3,14 @@ #include <QElapsedTimer> #include <QCoreApplication> #include <QDebug> +#include <QRandomGenerator> // 1M read size #define BUFFER_SIZE (1000000) // 20 seconds for each test #define TEST_LENGTH (60000) -#define BIGRAND (qint64(qrand()) | (qint64(qrand()) * qint64(RAND_MAX))) +#define BIGRAND (QRandomGenerator::global()->generate64()) CopyThread::CopyThread(QFile *file, QObject *parent) : QThread(parent), @@ -40,7 +41,7 @@ void CopyThread::run() const qint64 size = _file->size() - BUFFER_SIZE; // Sequential read - emit logMessage(trUtf8("Starting sequential read test")); + emit logMessage(tr("Starting sequential read test")); if (size > 0) { _file->seek(BIGRAND % size); } @@ -56,7 +57,7 @@ void CopyThread::run() // Random read if (size > 0) { - emit logMessage(trUtf8("Starting random read test")); + emit logMessage(tr("Starting random read test")); timer.restart(); do { _file->seek(BIGRAND % size); @@ -69,7 +70,7 @@ void CopyThread::run() // All done const qint64 seqSpeed = seqSum / (seqTime * 1024 + 1); const qint64 rndSpeed = rndSum / (rndTime * 1024 + 1); - emit logMessage(trUtf8("Seq: %1MiB/s, Random: %2MiB/s - [%3s / %4s]") + emit logMessage(tr("Seq: %1MiB/s, Random: %2MiB/s - [%3s / %4s]") .arg(QString::number(seqSpeed), QString::number(rndSpeed), QString::number(seqTime / 1000), QString::number(rndTime / 1000))); delete[] buffer; |