Bitcoin Forum
July 23, 2017, 12:48:19 AM *
News: The warning which may be displayed by Bitcoin Core about unknown versions is related to BIP91, and can be safely ignored.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: algorithm for calculating time to find block (using hashing power + difficulty)  (Read 2090 times)
Lightspeed
Full Member
***
Offline Offline

Activity: 126



View Profile
June 19, 2011, 01:06:38 PM
 #1

as in title, what's the algorithm?; straight code is fine

thanks

update found it:

time = difficulty * 2**32 / hashrate

Overclocking = money? Greatest full time hobby ever!
1AR2eheP4nckS3tuzZHG6ARYndeddxmeDg
1500770899
Hero Member
*
Offline Offline

Posts: 1500770899

View Profile Personal Message (Offline)

Ignore
1500770899
Reply with quote  #2

1500770899
Report to moderator
1500770899
Hero Member
*
Offline Offline

Posts: 1500770899

View Profile Personal Message (Offline)

Ignore
1500770899
Reply with quote  #2

1500770899
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1500770899
Hero Member
*
Offline Offline

Posts: 1500770899

View Profile Personal Message (Offline)

Ignore
1500770899
Reply with quote  #2

1500770899
Report to moderator
1500770899
Hero Member
*
Offline Offline

Posts: 1500770899

View Profile Personal Message (Offline)

Ignore
1500770899
Reply with quote  #2

1500770899
Report to moderator
[Coins!]
Member
**
Offline Offline

Activity: 112



View Profile
June 19, 2011, 02:45:12 PM
 #2

I expect you're probably writing some kind of code, but for most of us we just check the seconds remaining on block explorer:

http://blockexplorer.com/q/eta

Then divide by 3600 to get hours, and then divide by 24 to get days : )

As of now, the seconds are 514456, giving us just about 6 days to next retarget.

For my 330Mhash that is enough time for 2 more bitcoins.

edit: oh time to find block, not next difficulty~  never mind!

Like my post? Consider donating: 1ENPBz6zZa1maehG48PaYzYhPjodN1NkTF
http://oneminuteslow.com/bitcoin/100-20.png
Lightspeed
Full Member
***
Offline Offline

Activity: 126



View Profile
June 19, 2011, 06:03:08 PM
 #3

hey

i'm having a f**kload of trouble getting this to work:

formula
time = difficulty * 2**32 / hashrate

here is supposed working python
$ python -c "print 20000 * 2**32 / 10**9 / 60 / 60.0"

then here is my attempt in php:

$hashrate = in G/hash say 34.2

$time_to_find = ((($difficulty * 2^32 / $hashrate * 1000000000) / 60) / 60);

its returning 2000+ hours

where as actual is 34 hours, this is driving me nuts


working code update:

$time_to_find = (($difficulty * bcpow(2,32)) / ($hashrate * bcpow(10,9))) / 3600;

with the help of some IRC'ers in #ozcoin we fixed this

woot

Overclocking = money? Greatest full time hobby ever!
1AR2eheP4nckS3tuzZHG6ARYndeddxmeDg
bcpokey
Hero Member
*****
Offline Offline

Activity: 546



View Profile
June 19, 2011, 09:57:28 PM
 #4

http://www.alloscomp.com/bitcoin/calculator.pys



           ▄▄▄▄▄
     ▄▄█████████████▄
   ▄█████▀       ▀█████▄
 ▄████▀             ▀████▄
 ███▀                 ▀███▄
███▀   █████████████   ▀███
███    ▀▀▀▀▀███▀▀▀▀▀    ███
███         ███         ███
███▄        ███        ████
▀███▄       ███       ▄███▀
 ▀████▄     ▀▀▀     ▄████▀
   ▀█████▄▄     ▄▄█████▀
      ▀█████████████▀
           ▀▀▀▀▀▀
WeTrust.io


             ▄██▄
     ▄      ▐████   ▄▄
   █████     ██████████
    █████████████████▀
 ▄████████████▀████▌
██████████     ▀████
 ▀▀   █████     ██████████
      ▀████▌▄████████████▀
    ▄▄▄███████████████▌
   ██████████▀    ▐████
    ▀▀▀  ████▌     ▀▀▀
         ▀███▀


 ▄████████████████████▄
████████████████████████
██████████ ▀████████████
██████████    ▀█████████
██████████    ▄█████████
██████████ ▄████████████
████████████████████████
 ▀████████████████████▀

                 ▄████▄▄    ▄
██             ████████████▀
████▄         █████████████▀
▀████████▄▄   █████████████
▄▄█████████████████████████
██████████████████████████
  ▀██████████████████████
   █████████████████████
    ▀█████████████████▀
      ▄█████████████▀
▄▄███████████████▀
   ▀▀▀▀▀▀▀▀▀▀▀

  ▄██▄▄                ▄▄██▄
  ████████▄▄▄▄▄▄▄▄▄▄▄███████
  ██████████████████████████
  ██████████████████████████
▄████████████████████████████▄
██████████████████████████████▌
█████▀                  ▀█████▌
████    ███▄      ▄███    ████▌
████   ▐████      ████▌   ████
 ███    ▀██▀      ▀██▀    ███▀
  ▀██▄                  ▄██▀
    ▀▀██████████████████▀▀


Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!