Skip to content

Commit

Permalink
Tune status output delay
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Feb 13, 2024
1 parent d2558a4 commit 1cf7c0f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/stressTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "CmdOptions.hpp"

#include <stdint.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
Expand Down Expand Up @@ -304,13 +305,13 @@ void stressTest(const CmdOptions& opts)
std::chrono::duration<double> secsStatus = t2 - lastStatusOutput;

// We slowly increase the status output delay (in seconds)
// until it reaches one minute. This way, long running
// until it reaches 10 minutes. This way, long running
// computations don't produce excessive logs.
if (secsStatus.count() >= statusOutputDelay)
{
lastStatusOutput = t2;
statusOutputDelay += 1;
statusOutputDelay = inBetween(10, statusOutputDelay, 60);
statusOutputDelay += 5;
statusOutputDelay = std::min(statusOutputDelay, 600);
printResult(threadId, threads, i, count, secsThread, primeCounts);
}
}
Expand Down

0 comments on commit 1cf7c0f

Please sign in to comment.