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)
|
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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue