cazala / coin-hive

CoinHive cryptocurrency miner for node.js
https://www.npmjs.com/package/coin-hive
MIT License
1.98k stars 400 forks source link

Added a new --throttle option #72

Closed gnomelibre closed 6 years ago

gnomelibre commented 6 years ago

hello,

Would it be possible to add a new --throttle option to easily define the fraction of time that threads should be idle?

cazala commented 6 years ago

what would the usecase be?

gnomelibre commented 6 years ago

The options --threads and --throttle would allow us to finely configure the computing power and thus the system load. Especially since the official client already allows it:

.setThrottle(throttle)

Set the fraction of time that threads should be idle. A value of 0 means no throttling (i.e. full speed), a value of 0.5 means that threads will stay idle 50% of the time, with 0.8 they will stay idle 80% of the time.

BransonGitomeh commented 6 years ago

I support this idea

On Wed, Dec 13, 2017 at 11:04 AM, gnomelibre notifications@github.com wrote:

The options --threads and --throttle would allow us to finely configure the computing power and thus the system load. Especially since the official client already allows it:

.setThrottle(throttle)

Set the fraction of time that threads should be idle. A value of 0 means no throttling (i.e. full speed), a value of 0.5 means that threads will stay idle 50% of the time, with 0.8 they will stay idle 80% of the time.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cazala/coin-hive/issues/72#issuecomment-351313670, or mute the thread https://github.com/notifications/unsubscribe-auth/AKqeD7zCLrTic0pyHcH0naXH4fXpdBpkks5s_4UBgaJpZM4Q-T3S .

-- Much Regards

Branson G Kuria Systems Developer Sabek Systems

P.O Box 78024 Nairobi.

www.sabek.co.ke +254 711 657108

cazala commented 6 years ago

sorry i misunderstood when I read this yesterday :P i thought you were asking for an option to specify the idle time (like in milliseconds) instead of a percentage.

Yes sure, i'll add the option

cazala commented 6 years ago

this is available on version v1.10.0