计算估计的剩余时间 [英] Calculate estimated time remaining
问题描述
我制作了一个脚本,用于安装多个应用程序(Adobe Reader,Spotify,Microsoft Office等). Windows安装后使用.我想显示当前安装的估计剩余时间.
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
- 安装以前的应用程序所花费的时间,
- 申请总数和
- 已安装的应用程序的数量.
平均无济于事,因为某些应用程序安装了10秒,而另一些安装了5分钟.如何解决此问题?
Average wouldn't help since some applications install 10 seconds and other 5 minutes. How to resolve this issue?
推荐答案
…如果我知道安装以前的应用程序所花费的时间,应用程序的总数以及已安装的应用程序的数量,如何计算剩余时间.
… 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.
操作成本由CPU周期的数量定义,但与时间无关,因为周期管理是由请求它们的程序外部的因素控制的.结果,甚至两个连续的执行(相同的程序,相同的系统)也会根据完成所需的时间而变化.至于:
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-进度栏(估计移动平均值")
DataGenetics - Progress Bars (estimating "moving averages")
实用的解决方案是进行更新(
GUICtrlCreateProgress()
每次安装后使用GUICtrlSetData()
):$iProgress = ( $iAmountProgramsInstalled / $iAmountProgramsTotal ) * 100
Pragmatic solution is to update (
GUICtrlCreateProgress()
usingGUICtrlSetData()
) after each install:$iProgress = ( $iAmountProgramsInstalled / $iAmountProgramsTotal ) * 100
这篇关于计算估计的剩余时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!