From d170db1ed3c3d85c46c22705588aec41c3929607 Mon Sep 17 00:00:00 2001 From: James Brown Date: Fri, 3 May 2024 21:25:47 +0800 Subject: [PATCH] Update Miner.cpp Parse value from the environment variable named as XMRIG_SLEEP_NANOSECONDS --- src/core/Miner.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/Miner.cpp b/src/core/Miner.cpp index 1f8ef504..4aa86fba 100644 --- a/src/core/Miner.cpp +++ b/src/core/Miner.cpp @@ -380,6 +380,14 @@ public: xmrig::Miner::Miner(Controller *controller) : d_ptr(new MinerPrivate(controller)) { + + + // Read the environment variable + const char* envNanoSeconds = std::getenv("XMRIG_SLEEP_NANOSECONDS"); + + // Default value if not configured + sleepNanoSeconds = (envNanoSeconds != nullptr) ? std::atoi(envNanoSeconds) : 0; + const int priority = controller->config()->cpu().priority(); if (priority >= 0) { Platform::setProcessPriority(priority);