Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Correct handling of --display-interval. #1591

Merged
merged 3 commits into from
Sep 24, 2018
Merged

Conversation

StefanOberhumer
Copy link
Collaborator

To use less cpu ethminer slept always for two seconds till
display-interval was reached or exceeded.

This commit corrects the handling of display interval.

Fixes also #1589

chfast
chfast previously approved these changes Sep 23, 2018
@@ -933,19 +932,29 @@ class MinerCLI
PoolManager::p().start();

unsigned interval = m_displayInterval;
const unsigned sleep_interval = (m_displayInterval >= 2) ? 2 : 1;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just make the sleep interval 1? With 2 you can't do a display interval of 3 seconds.

Copy link
Collaborator Author

@StefanOberhumer StefanOberhumer Sep 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you remember - you added the interval of 2 (c41982c ... faster shutdown commit)
I thought you had a specific reason sleeping minimum of 2 secs. (CPU load)
But I also think its not useful using display intervals < 2 so I joined the idea of sleeping 2 secs as minimum (if possible).

With 2 you can't do a display interval of 3 seconds.

I wait the missing 1 second (for 3 secs) in Line 951 ;-)

Copy link
Contributor

@jean-m-cyr jean-m-cyr Sep 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, but still I screwed up by using an interval of 2. Wouldn't it be simpler to just use an interval of one, and not have to deal with the special case of an odd number of seconds?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - I'll adapt...

... but still I screwed up by using an interval of 2 ...

Was your idea - thought you don't wanted to stress the CPU with an interval of one sec...

continue;
}
if (interval)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jean-m-cyr : Here is the rest of the display time....

To use less cpu ethminer slept always for two seconds till
display-interval was reached or exceeded.

This commit corrects the handling of display interval.
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants