Calculate estimated time remaining

心已入冬 提交于 2019-12-08 03:33:24

问题


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

  • time taken to install previous applications,
  • amount of applications in total and
  • the count of already installed applications.

Average wouldn't help since some applications install 10 seconds and other 5 minutes. How to resolve this issue?


回答1:


… 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



来源:https://stackoverflow.com/questions/30426239/calculate-estimated-time-remaining

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!