Created
December 4, 2016 11:57
-
-
Save akirattii/18678ed86bb176418c5b70b031a72aab to your computer and use it in GitHub Desktop.
How to know how long your mining block will be found on Ethereum.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // How long it will take for finding your mining block | |
| // will be known from your 'hashrate' and the latest block's 'difficulty': | |
| etm = eth.getBlock("latest").difficulty / miner.hashrate; // estimated time in seconds | |
| Math.floor(etm / 3600.) + "h " + Math.floor((etm % 3600) / 60) + "m " + Math.floor(etm % 60) + "s"; | |
| // 1h 3m 30s | |
| // ref. https://ethereum.gitbooks.io/frontier-guide/content/mining_with_geth.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment