Bitcoin Forum
May 21, 2024, 08:49:01 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How is “progress per hour” calculated?  (Read 135 times)
RicardoReis (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
July 30, 2022, 04:38:32 PM
 #1

How is “progress per hour” calculated?

https://i.ibb.co/ZGB6bSY/09369311-B43-E-40-D3-BC78-06-A5-C280-E574.jpg

What would be the shell script code to return this result?
NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6753


bitcoincleanup.com / bitmixlist.org


View Profile WWW
July 31, 2022, 04:25:47 AM
Merited by BlackHatCoiner (4), pooya87 (2), ABCbits (2), vapourminer (1), seoincorporation (1), DdmrDdmr (1)
 #2

At src/qt/modaloverlaycpp, around line 110:

Code:
progressDelta = blockProcessTime[0].second - sample.second;
timeDelta = blockProcessTime[0].first - sample.first;
progressPerHour = progressDelta / (double) timeDelta * 1000 * 3600;
remainingMSecs = (progressDelta > 0) ? remainingProgress / progressDelta * timeDelta : -1;

The progress per hour and time remaining is updated every 500 milliseconds, or if the same block is still the latest one processed after 500 milliseconds.

The progress and time deltas are calculated by subtracting the last processed block's time and progress by the second last processed block's time and progress (progress per hour is only displayed if there is at least two blocks processed),

then the progress per hour divides the progressDelta by timeDelta and then converts from milliseconds to hours.

As a bonus, it also calculates the remaining milliseconds from these two last blocks (which explains why the remaining time fluctuates wildly with the connection speed) by dividing the remaining progress (calculated above as 1 - progress), by the progress delta and then multiplying that by the timedelta.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
RicardoReis (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
August 03, 2022, 08:40:53 PM
 #3


Thanks.  Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!