Code:
Time = difficulty * 2^32 / hashrate
and rearrange it to solve for the average hash rate needed to find a block in the amount of time it actually took at the current difficulty.
Code:
Hashrate = difficulty * 2^32 / Time
Since difficulty is set using a specific time (10 minutes), if the next block is found in 2 minutes, it would indicate that the network had five times more hashing power than needed for a 10 minute block. Conversely, a 20 minute block would indicate half the hashing power is on the network. However, finding a block is mostly luck. So knowing how much hashing power there truly is on the network can never be known.