6
$\begingroup$

Is it possible to know how much % of calculations are done in a big program?

In other words, % will increase gradually when the calculations are progressing. I want to see the %.

$\endgroup$
  • 2
    $\begingroup$ Try using Monitor $\endgroup$ – J42161217 Apr 1 at 10:31
  • 1
    $\begingroup$ You may also be interested in the ForScience paclet which includes a very nice ProgressReport function. $\endgroup$ – Carl Lange Apr 1 at 10:59
8
$\begingroup$

You need to estimate and display that percentage yourself. This estimation must be part of the program you write. There is no way to do it automatically either in Mathematica or any other system. Theoretically, it is not even possible to decide if an arbitrary algorithm will ever finish, let alone how many steps away it is from finishing.


If your algorithm is a simple loop, in practice Monitor is often useful.

Monitor[ Table[Pause[1]; i^2, {i, 30}], i ]

My point still stands though. Here, i could be used as a proxy for progress. In a complicated program, you need to compute a value that can be used for this purpose yourself. Then you can use Monitor with it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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