Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I think the best way to track time across subprocesses is to use the cputime command in Sage. It takes a keyword arguments subprocesses=True which will try to track the time spent in subprocesses.

sage: t = cputime(subprocesses=True);
sage: integrate(sin(log(x))^2, x)
-1/5*x*sin(2*log(x)) - 1/10*x*cos(2*log(x)) + 1/2*x
sage: cputime(subprocesses=True) - t
0.13

Compare this with the non- subprocesses=True version:

sage: t = cputime();
sage: integrate(sin(log(x))^2, x)
-1/5*x*sin(2*log(x)) - 1/10*x*cos(2*log(x)) + 1/2*x
sage: cputime() - t
0.0099999999999997868

This currently works by using thing cputime method on expect interface objects.