How do computers figure out how long a certain operation will take? i.e. Copying a directory of files or performing a system update.

355 viewsOtherTechnology

How do computers figure out how long a certain operation will take? i.e. Copying a directory of files or performing a system update.

In: Technology

5 Answers

Anonymous 0 Comments

That’s a really good question; it’s more difficult than it sounds!

Something like a directory copy isn’t too difficult as the estimate of time is directly related to the number of files & their sizes. And although the estimate will vary greatly depending on the hardware and bandwidth that the software is running on, it is fairly simple to time the first say, 5% of the copy, and then extrapolate.

Back in the day I was responsible for writing a Windows installation program, and although much of its job was to copy files around, it was a bit more complex as there were multiple stages involved (unzipping, updating registry, checking for dependencies & DLL versions etc.)

After a few days work, I was very proud that I had honed the algorithm for estimating the time remaining to the point where it was simply counting down the seconds remaining without any noticeable stuttering. (Basically by regularly remeasuring progress and re-extrapolating through all installation stages).

My pride was short lived as I heard the whole team complaining ‘why is it taking so long to install nowadays?’. Sure enough, my accurate ‘time remaining’ feature was now responsible for half the installation time. I was quickly instructed to replace it with a less accurate but more time efficient version. 🙁

You are viewing 1 out of 5 answers, click here to view all answers.