3
$\begingroup$

Possible Duplicate:
Profiling from Mathematica

How can I easily get fractions of timing for each nested function?

Consider a nested call like this:

Total[DigitCount[Mod[(2^10000) + 1, Prime[100]]]]

I don't want to assign each parameter to a variable and wrap Timing around it, but looking for a way to wrap the hole expression with Timing and get fractions of total time for each function.

$\endgroup$

marked as duplicate by rm -rf Nov 25 '12 at 16:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5
$\begingroup$

According to Leonid Shifrin recommendation:

Put your Mathematica session in debug mode by going to Evaluation->Debugger

F[x_] := Total[DigitCount[Mod[(2^10000) + 1, Prime[x]]]]

Table[F[x], {100000}]; // RuntimeTools`Profile

enter image description here

$\endgroup$
  • $\begingroup$ I've closed this as a duplicate (since it is), but you can mark your own answer as accepted (I don't know if you have to wait a few hours) $\endgroup$ – rm -rf Nov 25 '12 at 16:36
  • 1
    $\begingroup$ Well, thanks for ackowledging, but the recommendation was really not mine - I merely pointed to that discussion, the real credit goes to those who provided the answers there. $\endgroup$ – Leonid Shifrin Nov 27 '12 at 11:32

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