I have a time consuming function that is going to be iterated in a Nest
or NestList
and I would like to know if there is a good way to monitor the progress. I have found a partial work-around, but it requires an extra global variable (n).
fun[x_] := Module[{}, n++; Pause[1]];
ProgressIndicator[Dynamic[n/5]]
n = 0; NestList[fun, Null, 5]
Besides being poor coding practice, this is a problem because when I call the Nest from different places in the larger code (for example, make two copies of the above and execute both), all the progress indicators move synchronously, rather than being limited to the NestList
that is actually executing.