Two related questions: I'd like to measure the CPU time used by a computation. Should I use with(CodeTools)? or use time[real]? What would be the most accurate way to measure the CPU time used by one call, say dsolve()?
Also, How would one return both the result of the computation and the time used in one call so that one does not have to make two separate calls: to obtain the result and to obtain the CPU time?
Gives result:=0.141 while
Gives result:= 0.145
But in both cases, I have to make another call to get the result of the DSolve in this example. result:=dsolve(ode=0,y(x)); which I'd like to avoid if possible.
I am using Maple 18