On 19/11/2011 11:46, Mark wrote:
> Hello community:
>
> When I run the following expression below, It returns the value of zero for the timing. If I press "shift enter" again, it then correctly returns the amount of time for the expression to run / plot.
>
> Also, I noticed that if I change the variable from x^3 to x^2 and press "shift enter" at that point, zero again is returned for the timing result. I am using Mathematica 8.01
>
> Timing[Plot[x^3, {x, -5, 5}]]
>
> Does anyone know the reason for this?
>
The clock granularity has already been mentioned, but I suspect perhaps
that if you are timing Plot commands, you are struggling with more
complex plots that are irritatingly slow! A complication is that Timing
only measures the time used by the kernel, and for some plots, most of
the time is consumed in the frontend. Even AbsoluteTime does not solve
this problem easily, because it returns its result before the FE starts
its work.
I gave a talk at the 2010 autumn conference in Champaign discussing a
variety of subtle timing issues including this problem. You will find a
link to this presentation here:
http://www.wolfram.com/events/techconf2010/speakers.html
David Bailey
http://www.dbaileyconsultancy.co.uk