If we have a procedural construct like a Do loop or Table, it is straightforward to make a progress bar to indicate the percent completion of the task. For example:

f[k_] := RandomInteger[{-k, k}, 1000000];
Do[f[k], {k, Range[100]}]

Replacing Do by Table works as well. But I have grown fond of the "functional style" using Map:

f[#]& /@ Range[100]

Is there a way to make a progress indicator that works with this style of iteration?

  • $\begingroup$ related $\endgroup$
    – Kuba
    Mar 28, 2015 at 15:36

1 Answer 1


You can include an iterator along with the function in the mapping:

k = 0; (++k; f[#]) & /@ Range[100];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.