Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/program_runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ class ProgramRunner {

bool is_finished();

void warmup(uint64_t iterations = 1000);

const std::string version = "0.1";
const std::string program_name = "randomizer";





private:
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

int main(int argc, char *argv[]){
ProgramRunner runner = ProgramRunner(argc, argv);
runner.warmup();
ProgramRunner::ProgramStatus status;
while (!runner.is_finished()) {
status = runner.iterate();
Expand Down
6 changes: 6 additions & 0 deletions src/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,10 @@ ProgramRunner::ProgramStatus ProgramRunner::run() {
throw std::runtime_error("ProgramRunner has finished without returning an exit code. This should not happen.");
}

void ProgramRunner::warmup(uint64_t iterations) {
for (uint64_t i = 0; i < iterations; ++i) {
this->prng->generateRandomValue(); // Warmup the PRNG
}
}


Loading