I have a table that takes a long time to calculate because f[x] is quite a complicated function:

Table[f[x], {m, 50, 1000, 50}, {x, 0, 50}]

It would be great to have a progress bar to give some idea of how long the evaluation will take to complete. Ideally, I would also like a counter stating which values of m and x are currently being assessed.

This thread offers a simple progress bar:

 Table[Pause[0.1]; Prime[i], {i, 100}],
  Row[{ProgressIndicator[i, {1, 100}], i}, " "]

But I can't figure out how to adapt this for a multi-row table with two variables, or how to produce a counter that tells me what values of m and x are currently being evaluated.

I'd be very grateful for any solutions.

  • 2
    $\begingroup$ Monitor[ Table[Pause[0.01]; Prime[m x], {m, 50, 1000, 50}, {x, 1, 50}], Grid[{ {"Total progress:", ProgressIndicator[Dynamic[m/1000]]}, {"Current row progress:", ProgressIndicator[Dynamic[x/50]]}, {"{m, x}=", {Dynamic@m, Dynamic@x}} }] ]? $\endgroup$
    – Kuba
    Commented May 16, 2018 at 19:07

1 Answer 1


How about a simple method such as this. You can easily adjust as needed. It hard to guess how long it will take each step. This assumes each step takes same amount of time. This is how ProgressIndicator works.

ClearAll[n, m, p];
f[n_] := FactorInteger[2^n - 1];

nRows = 10;
nCols = 20;
total = nRows*nCols;
p = 0;

  {Row[{"row ", Dynamic@m, " column ", Dynamic@n}]},
  {ProgressIndicator[Dynamic[p], {1, total}]}

  p += 1;
  {m, 1, nRows}
 {n, 1, nCols}


enter image description here

  • $\begingroup$ Thanks for both suggestions. I'm away from my computer iuntil morning now, but will report back. $\endgroup$ Commented May 16, 2018 at 19:14
  • $\begingroup$ Both of these work. I can only tick the one that's proposed as an answer, though. Much appreciated. $\endgroup$ Commented May 17, 2018 at 7:38

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.