diff options
author | Simon Rettberg | 2022-06-22 14:51:33 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-06-22 14:51:33 +0200 |
commit | 1dce9dc9cf3fc19a6ea35965c96cd2def9136710 (patch) | |
tree | e802dfce183b3ccd797e6d18278fcc11e548d185 | |
parent | Add --auto option to start immediately and quit when done (diff) | |
download | speedcheck-1dce9dc9cf3fc19a6ea35965c96cd2def9136710.tar.gz speedcheck-1dce9dc9cf3fc19a6ea35965c96cd2def9136710.tar.xz speedcheck-1dce9dc9cf3fc19a6ea35965c96cd2def9136710.zip |
Don't restart reading after reaching end of input file
-rw-r--r-- | src/copythread.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/copythread.cpp b/src/copythread.cpp index ffec902..21aadbb 100644 --- a/src/copythread.cpp +++ b/src/copythread.cpp @@ -42,16 +42,12 @@ void CopyThread::run() // Sequential read emit logMessage(tr("Starting sequential read test")); - if (size > 0) { - _file->seek(BIGRAND % size); - } timer.start(); do { ret = _file->read(buffer, BUFFER_SIZE); seqSum += ret; - if (ret == 0) { - _file->seek(0); - } + if (ret == 0) + break; // EOF } while (!_doStop && ret >= 0 && timer.elapsed() < TEST_LENGTH); seqTime = timer.elapsed(); |