Commit f274fe25 authored by Jens Korinth's avatar Jens Korinth

Improve TransferSpeed loop, reduce load

parent 8d6d9989
......@@ -45,12 +45,12 @@ public:
duration<double> d = steady_clock::now() - tstart;
future<void> f = async(launch::async, [&]() { transfer(stop, chunk_sz, opmask); });
do {
b = bytes.load() / (1024.0 * 1024.0);
d = steady_clock::now() - tstart;
mvprintw(y, x, "Chunk size: %8.2f KiB, Mask: %s, Speed: %8.2f MiB/s",
cs, ms.c_str(), cavg());
refresh();
usleep(1000000);
b = bytes.load() / (1024.0 * 1024.0);
d = steady_clock::now() - tstart;
} while (getch() == ERR && (fabs(cavg.update(b / d.count())) > 0.1 || cavg.size() < 30));
stop = true;
f.get();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment