mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-12 01:42:48 -05:00
Update Miner.cpp
Parse value from the environment variable named as XMRIG_SLEEP_NANOSECONDS
This commit is contained in:
@@ -380,6 +380,14 @@ public:
|
|||||||
xmrig::Miner::Miner(Controller *controller)
|
xmrig::Miner::Miner(Controller *controller)
|
||||||
: d_ptr(new MinerPrivate(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();
|
const int priority = controller->config()->cpu().priority();
|
||||||
if (priority >= 0) {
|
if (priority >= 0) {
|
||||||
Platform::setProcessPriority(priority);
|
Platform::setProcessPriority(priority);
|
||||||
|
|||||||
Reference in New Issue
Block a user