# Progress bar estimated Time

Hello guys,

Is there a way to get the estimated progress in time rather than percentage ? or at least estimated time ? I do some data processing and i need some kind of estimate to know how long it will take.

So far the difference is huge between Windows and mac , maybe as well the hdd is the issue but still, on mac 2 min to process 85000 records, windows 20 min , same code , so i wanted to have a way to calculate an estimate time and to let the user how long it will take so it knows that the app is processing and it will take that time.

Thanks.

Yes. You need to calculate it.

One simple way to do this: Take 2 or more progress-points, measure the time in between and multiply it, so you have a rough estimated time to complete the whole. From time to time measure again and update the estimated time. Or measure constantly and calculate an average and multiply it again.

• Before Loop Starts, get the current time.
• For every x records processed, calc the time it took to process the number records you processed.
• Divide the time by the number of records you processed so far.
• Multiply that by the number of records that remain which will tell you about how much long it should take.

It’ll get more accurate the further along in the loop you get.

For the “every x records processed” we use:
theCount < 20 = 1
theCount < 50 = 2
theCount < 100 = 5
theCount < 1000 = Floor ( theCount / 10 )
Otherwise = Floor ( theCount / 100 )

But do not invest too much time into this. It may/will be always a rough estimate.