From ca3bb64aaeada60e8e20a81bcbae6b22e2737594 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 12 Dec 2025 05:39:44 +0000 Subject: [PATCH] Allow compiler-level declarations for the thread timers We use a #define here to set these up - if you define them via a -D block yourself, you can adjust these as you require. --- src/worker.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/worker.hpp b/src/worker.hpp index cae2bbd..911ff41 100644 --- a/src/worker.hpp +++ b/src/worker.hpp @@ -13,12 +13,21 @@ #include "state.hpp" +#ifndef THREAD_PAUSE_MS +#define THREAD_PAUSE_MS 1000 +#endif +#ifndef THREAD_GENERAL_MS +#define THREAD_GENERAL_MS 10 +#endif + namespace cw::worker { using cw::node::NodeAllocator; using cw::state::State; - constexpr auto THREAD_PAUSE_DELAY = std::chrono::milliseconds(1000); - constexpr auto THREAD_GENERAL_DELAY = std::chrono::milliseconds(10); + constexpr auto THREAD_PAUSE_DELAY = + std::chrono::milliseconds(THREAD_PAUSE_MS); + constexpr auto THREAD_GENERAL_DELAY = + std::chrono::milliseconds(THREAD_GENERAL_MS); // Performs a single iteration which consists of the following: // 1) pop an index off the iteration queue