Skip to main content

Windows如何確定使用文件執行操作所需的時間量?

Windows如何確定使用文件執行操作所需的時間量?

Geoffrey Carr

Windows上的“剩餘時間”估計足以讓任何人瘋狂,但你有沒有想過Windows如何確定這些時間?今天的超級用戶問答帖子為一個好奇但又沮喪的讀者問題提供了一些答案。

今天的問答環節由SuperUser提供,這是Stack Exchange的一個細分,Stack Exchange是一個社區驅動的問答網站分組。

Windows 8.1文件傳輸窗口截圖由我真正的famecore提供。

問題

SuperUser reader'im really famecore'想知道Windows如何確定使用文件執行操作所需的時間:

I wanted to know if there is an equation that Windows uses to determine how long it takes to perform an action with a file such as: deleting, copying, erasing, or installing.

For example, when I delete a file and Windows says Time remaining: 18 seconds, how is it calculating this number, and what does it use to calculate it?

Windows是否使用特殊等式​​來確定執行操作的剩餘時間,還是只提供“最佳猜測”估算?

答案

超級用戶貢獻者Valmiky Arquissandas和Richard為我們提供了答案。首先,Valmiky Arquissandas:

Have you noticed that it usually does not give you any estimates during the first few seconds?

That is because during the first few seconds, it just does the operation it has to do. Then, after a short amount of time, it knows how much it has already copied/deleted/etc, and how long it took. That gives you the average speed of the operation.

Then, divide the remaining bytes by the speed, and you have the time it will take to complete the operation.

This is elementary school math. If you want to travel 360 km, and at the end of the first minute you have traveled 1 km, how long will it take you to reach your destination?

Well, the speed is 1 km/minute, so that is 60 km/hour. 360 km divided by 60 km/hour gives you an estimated time of 6 hours (or 360 km / 1 km/minute = 360 minutes = 6 hours). Since you have already traveled for one minute, then the estimated time left is 5 hours and 59 minutes.

Substitute travel with copy, km with bytes, and that answers your question.

Different systems have different ways of estimating time. You can take the last minute and the estimates may vary wildly. Or you can take the full time, and if the speed actually changes permanently, your estimates may be far removed from reality. What I described is the simplest method.

接下來是理查德的回答:

If you are interested, this question tells you how Windows and OSX formats the time left into the progress bar once it has an idea how long it has remaining.

When shortening time expressions in progress dialogs, should they be rounded up or down?

Raymond Chen, a developer on the Windows team at Microsoft, confirms this algorithm (see Valmiky’s answer above) in a posting on his blog. He also explains why it can be wrong.

Why does the copy dialog give such horrible estimates?


有什麼要補充說明嗎?在評論中發聲。想要從其他精通技術的Stack Exchange用戶那裡閱讀更多答案嗎?在這裡查看完整的討論主題。

Link
Plus
Send
Send
Pin