Function Repository Resource:


Source Notebook

Display progress of a computation together with estimated completion time

Contributed by: Jon McLoone


represents a progress indicator and remaining time estimator with the range xmin to xmax.

Details and Options

xmin and xmax should be chosen to indicate the expected range of values that x must take before a computation is complete.
All options for ProgressIndicator are supported.


Basic Examples (2) 

Display an estimate of completion time for a simple Do loop:

Monitor[Do[Pause[Random[]], {x, 0, 30}], ResourceFunction["ProgressIndicatorEstimator"][Dynamic[x], {0, 30}]]

Display an estimate of completion time for a simple While loop:

x = 0; Monitor[While[x < 200, Pause[Random[]]; x += RandomReal[10]], ResourceFunction["ProgressIndicatorEstimator"][Dynamic[x], {0, 200}]]

Options (3) 

Control the refresh rate of the estimator. Note that a refresh rate shorter than the expected interval between changes to the tracked variable will result in an estimate that rises in a sawtooth, especially early in the process:

Monitor[Do[Pause[RandomReal[1]], {x, 0, 60}], ResourceFunction["ProgressIndicatorEstimator"][Dynamic[x], {0, 60}, UpdateInterval -> 5]]

If the progress is expected to be nonlinear, then use "History" to consider only recent progress. This example resets the estimator each time 10% progress is made:

Monitor[Do[Pause[x/30], {x, 0, 60}], ResourceFunction["ProgressIndicatorEstimator"][Dynamic[x], {0, 60}, "History" -> 0.1]]

Appearance None will not display the ProgressIndicator:

Monitor[Do[Pause[Random[]], {x, 0, 30}], ResourceFunction["ProgressIndicatorEstimator"][Dynamic[x], {0, 30}, Appearance -> None]]

Possible Issues (2) 

If the tracked symbol does not fall in the expected interval, then no estimate is returned:

Monitor[Do[Pause[RandomReal[1]], {x, 61, 90}], ResourceFunction["ProgressIndicatorEstimator"][Dynamic[x], {0, 60}]]

If the tracked symbol does represent progress monotonically from the start value to end value, then the time estimates are meaningless:

Monitor[Do[Pause[RandomReal[1]]; x = RandomReal[{0, 60}], {60}], ResourceFunction["ProgressIndicatorEstimator"][Dynamic[x], {0, 60}]]


Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 16 January 2019

License Information