mirror of
https://github.com/xmrig/xmrig.git
synced 2025-02-24 03:50:30 +00:00
Update Miner.cpp
Parse value from the environment variable named as XMRIG_SLEEP_NANOSECONDS
This commit is contained in:
parent
7ad834de92
commit
d170db1ed3
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue