From 62b73ac91a7c6706d37b8758e10f76de2db24d1c Mon Sep 17 00:00:00 2001 From: YZBruh Date: Fri, 15 Aug 2025 22:47:13 +0300 Subject: [PATCH] fix looping memory test function --- src/functions/MemoryTestFunction.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/functions/MemoryTestFunction.cpp b/src/functions/MemoryTestFunction.cpp index 26e0351..7b85b49 100644 --- a/src/functions/MemoryTestFunction.cpp +++ b/src/functions/MemoryTestFunction.cpp @@ -84,17 +84,17 @@ bool memoryTestFunction::run() { const ssize_t ret = write(wfd, buffer, bufferSize); if (ret < 0) throw Error("Can't write to test file: %s\n", strerror(errno)); bytesWritten += ret; - - const auto endWrite = std::chrono::high_resolution_clock::now(); - - const double writeTime = - std::chrono::duration(endWrite - startWrite).count(); - println("Sequential write speed: %3.f MB/s", - (static_cast(testFileSize) / (1024.0 * 1024.0)) / - writeTime); - LOGN(MTFUN, INFO) << "Sequential write test done!" << std::endl; } + const auto endWrite = std::chrono::high_resolution_clock::now(); + + const double writeTime = + std::chrono::duration(endWrite - startWrite).count(); + println("Sequential write speed: %3.f MB/s", + (static_cast(testFileSize) / (1024.0 * 1024.0)) / + writeTime); + LOGN(MTFUN, INFO) << "Sequential write test done!" << std::endl; + if (!doNotReadTest) { auto *rawBuffer = new char[bufferSize + 4096]; collector.delAfterProgress(rawBuffer);