|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
AbsoluteTiming
AbsoluteTiming[expr]
evaluates expr, returning a list of the absolute number of seconds in real time that have elapsed, together with the result obtained.
DetailsDetails
- AbsoluteTiming has attribute HoldAll.
- AbsoluteTiming[expr;] will give {timing, Null}.
- AbsoluteTiming is always accurate down to a granularity of $TimeUnit seconds, but on many systems is much more accurate.
- AbsoluteTiming[expr] measures only the time involved in actually evaluating expr, not time involved in formatting the result.
ExamplesExamplesopen allclose all
Basic Examples (2)Basic Examples (2)
Get the total time to do a computation:
| In[1]:= |
| Out[1]= |
Timing just reports CPU time used:
| In[2]:= |
| Out[2]= |
AbsoluteTiming takes into account all time, including getting data over the internet if needed:
| In[1]:= |
| Out[1]= |
The second time it is run is faster since the data has been saved for immediate reuse:
| In[2]:= |
| Out[2]= |
New in 5
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
