计算预计剩余时间 [英] Calculate estimated time remaining

查看:40
本文介绍了计算预计剩余时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个脚本来安装多个应用程序(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 - 进度条(估计移动平均线")

    实用的解决方案是更新(GUICtrlCreateProgress() 使用 GUICtrlSetData()) 每次安装后:$iProgress = ( $iAmountProgramsInstalled/$iAmountProgramsTotal ) * 100

    Pragmatic solution is to update (GUICtrlCreateProgress() using GUICtrlSetData()) after each install: $iProgress = ( $iAmountProgramsInstalled / $iAmountProgramsTotal ) * 100

    这篇关于计算预计剩余时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆