Reputation: 122
I made a script which installs several applications (Adobe Reader, Spotify, Microsoft Office, etc.). It's used after Windows installation. I would like to display estimated remaining time of current installation.
The problem is it differs per computer. How to calculate remaining time using
Average wouldn't help since some applications install 10 seconds and other 5 minutes. How to resolve this issue?
Upvotes: 1
Views: 2263
Reputation: 3002
… how could I calculate the remaining time if I know time taken to install previous applications, the count of applications in total and the count of already installed applications.
It is impossible to (accurately) calculate remaining time.
Cost of operation is defined by amount of CPU cycles but bears no relation to time as cycle management is controlled by factors external to the program requesting them. As a result, even two consecutive executions (same program, same system) vary by time needed to complete. As for:
… any idea how could i resolve this issue.
DataGenetics - Progress Bars (estimating "moving averages")
Pragmatic solution is to update (GUICtrlCreateProgress()
using GUICtrlSetData()
) after each install:
$iProgress = ( $iAmountProgramsInstalled / $iAmountProgramsTotal ) * 100
Upvotes: 2