# How to calculate Hashes per Second

How exactly do you calculate how many hashes your hardware is generating?

Most mining software will have that number available for you. Or you can join a pool for a day or two and most of the bigger ones (eg slush, 50btc) make these stats available for your miner(s).

If you are trying to programmatically calculate this for software you are writing probably best to take an average every minute or so. As in most cases, the formula is built right into the unit -- num of hashes per (ie divided by) num of seconds.

Actually it's Mh/s (1,000,000 hash/sec) usually now so more like (Num hashes / 1,000,000) / sec

• And that is so absolutly an example how to provide a useless answer. The question is "HOW IS IT CALCULATED" and your answer is "look at the number on your screen". Nice. Commented Dec 7, 2013 at 16:42
• Please don't get defensive. I answered that exact question and offered some additional information. You are right that it seems like too basic of a question; but i think it would be more productive to assume that maybe he meant something slightly different than what was written (ie how do I time hashes when mining on x hardware with y driver?). Commented Dec 7, 2013 at 17:03
• lol, the getmininginfo command of bitcoin-cli provides this info once bitcoind has finished downloading block data. Commented Dec 8, 2013 at 9:21
• kilo = 1 000, mega = 1 000 000. You've got something mixed up in your last sentence. Commented Apr 24, 2014 at 19:52
• @TimS oops, you're right! Wow that went unnoticed far too long. Fixed Commented Apr 24, 2014 at 23:49

Ah, you start generating, after one second you cound how many you generated. If that is too random (generation of one takes too long), you generate for 10 seconds, count, divide by 10.

Is that THAT hard? Counting things and dividing by time are pretty obvious, or?

• This is a little unnecessarily condescending I think. Commented Dec 7, 2013 at 16:38
• You are right. Not everyone using a computer can use a clock and count. At least it seems to be the case... Commented Dec 7, 2013 at 16:41

lol the Q/A contains far too much flaming and too little answers.

Obviously, hashes per second can be computed by some sort of some of hashes per time frame, divided by time in frame.

like... 0% of mining hardware will deliver its full-on however-millions-of-hashes directly to the mining software. From what I can tell, there's 2 other ways to measure the metric:

1. # of qualified nonces to produce hash. As far as I know, this figures in the 'difficulty 1' mask. Some mining software when dealing with pools will throw out a great number of these unless they match the suggested share difficulty. Brings me to metric #2
2. # of submitted shares, given current share difficulty. I believe this is how pools calculate your H/s. It's more variant because of the lower number of shares. I believe this can be computed by your 'accepted' rate, the share difficulty, and the block difficulty (i think???)

Any clarification on these would be.... really awesome